Skip to content

Commit be14cc9

Browse files
dingtianhongdavem330
authored andcommitted
vlan: use use ether_addr_equal_64bits to instead of ether_addr_equal
Ether_addr_equal_64bits is more efficient than ether_addr_equal, and can be used when each argument is an array within a structure that contains at least two bytes of data beyond the array, so it is safe to use it for vlan, and make sense for fast path. Cc: Joe Perches <[email protected]> Cc: Patrick McHardy <[email protected]> Cc: David S. Miller <[email protected]> Signed-off-by: Ding Tianhong <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 375f67d commit be14cc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/8021q/vlan_core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bool vlan_do_receive(struct sk_buff **skbp)
2626
/* Our lower layer thinks this is not local, let's make sure.
2727
* This allows the VLAN to have a different MAC than the
2828
* underlying device, and still route correctly. */
29-
if (ether_addr_equal(eth_hdr(skb)->h_dest, vlan_dev->dev_addr))
29+
if (ether_addr_equal_64bits(eth_hdr(skb)->h_dest, vlan_dev->dev_addr))
3030
skb->pkt_type = PACKET_HOST;
3131
}
3232

0 commit comments

Comments
 (0)