summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorHuang Guobin <huangguobin4@huawei.com>2020-08-02 22:00:55 -0400
committerDavid S. Miller <davem@davemloft.net>2020-08-03 16:21:46 -0700
commitfbc97de84ef88bc38874c41be151cf220c72a865 (patch)
tree4979d9522a3d4cec7f721194c139c74f195f66f8 /net
parent6c09b484377cc8f135a20390c99d7e0d71b1b888 (diff)
downloadlinux-fbc97de84ef88bc38874c41be151cf220c72a865.tar.bz2
tipc: Use is_broadcast_ether_addr() instead of memcmp()
Using is_broadcast_ether_addr() instead of directly use memcmp() to determine if the ethernet address is broadcast address. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Huang Guobin <huangguobin4@huawei.com> Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/tipc/eth_media.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/tipc/eth_media.c b/net/tipc/eth_media.c
index 8b0bb600602d..c68019697cfe 100644
--- a/net/tipc/eth_media.c
+++ b/net/tipc/eth_media.c
@@ -62,12 +62,10 @@ static int tipc_eth_raw2addr(struct tipc_bearer *b,
struct tipc_media_addr *addr,
char *msg)
{
- char bcast_mac[ETH_ALEN] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
-
memset(addr, 0, sizeof(*addr));
ether_addr_copy(addr->value, msg);
addr->media_id = TIPC_MEDIA_TYPE_ETH;
- addr->broadcast = !memcmp(addr->value, bcast_mac, ETH_ALEN);
+ addr->broadcast = is_broadcast_ether_addr(addr->value);
return 0;
}