aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordingtianhong <dingtianhong@huawei.com>2013-12-26 06:41:05 -0500
committerDavid S. Miller <davem@davemloft.net>2013-12-26 13:31:34 -0500
commit48f045b9115bb26e08f065840d7732d920525e30 (patch)
treeb973c6833a91e12d09416fa8b081b9e91a6c83c0
parent4c55a4623aa0ec6d8af5eec1e58c3015a7025f7b (diff)
isdn: slight optimization of addr compare
Use possibly more efficient ether_addr_equal instead of memcmp. Cc: Karsten Keil <isdn@linux-pingi.de> Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/isdn/i4l/isdn_net.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 8b98d53d9976..d9aebbc510cc 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -1371,7 +1371,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
1371 eth = eth_hdr(skb); 1371 eth = eth_hdr(skb);
1372 1372
1373 if (*eth->h_dest & 1) { 1373 if (*eth->h_dest & 1) {
1374 if (memcmp(eth->h_dest, dev->broadcast, ETH_ALEN) == 0) 1374 if (ether_addr_equal(eth->h_dest, dev->broadcast))
1375 skb->pkt_type = PACKET_BROADCAST; 1375 skb->pkt_type = PACKET_BROADCAST;
1376 else 1376 else
1377 skb->pkt_type = PACKET_MULTICAST; 1377 skb->pkt_type = PACKET_MULTICAST;
@@ -1382,7 +1382,7 @@ isdn_net_type_trans(struct sk_buff *skb, struct net_device *dev)
1382 */ 1382 */
1383 1383
1384 else if (dev->flags & (IFF_PROMISC /*| IFF_ALLMULTI*/)) { 1384 else if (dev->flags & (IFF_PROMISC /*| IFF_ALLMULTI*/)) {
1385 if (memcmp(eth->h_dest, dev->dev_addr, ETH_ALEN)) 1385 if (!ether_addr_equal(eth->h_dest, dev->dev_addr))
1386 skb->pkt_type = PACKET_OTHERHOST; 1386 skb->pkt_type = PACKET_OTHERHOST;
1387 } 1387 }
1388 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN) 1388 if (ntohs(eth->h_proto) >= ETH_P_802_3_MIN)