We can also compare with dev->broadcast instead to have some macro which
compare with static numbers.

Signed-off-by: Alexander Aring <alex.ar...@gmail.com>
---
 include/net/6lowpan.h         | 10 ----------
 net/ieee802154/6lowpan_rtnl.c |  2 +-
 2 files changed, 1 insertion(+), 11 deletions(-)

diff --git a/include/net/6lowpan.h b/include/net/6lowpan.h
index f7d372b..1e97017 100644
--- a/include/net/6lowpan.h
+++ b/include/net/6lowpan.h
@@ -143,16 +143,6 @@
         (((a)->s6_addr16[6]) == 0) &&          \
         (((a)->s6_addr[14]) == 0))
 
-#define lowpan_is_addr_broadcast(a)    \
-       ((((a)[0]) == 0xFF) &&  \
-        (((a)[1]) == 0xFF) &&  \
-        (((a)[2]) == 0xFF) &&  \
-        (((a)[3]) == 0xFF) &&  \
-        (((a)[4]) == 0xFF) &&  \
-        (((a)[5]) == 0xFF) &&  \
-        (((a)[6]) == 0xFF) &&  \
-        (((a)[7]) == 0xFF))
-
 #define LOWPAN_DISPATCH_IPV6   0x41 /* 01000001 = 65 */
 #define LOWPAN_DISPATCH_HC1    0x42 /* 01000010 = 66 */
 #define LOWPAN_DISPATCH_IPHC   0x60 /* 011xxxxx = ... */
diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c
index 710e06a..2566dad 100644
--- a/net/ieee802154/6lowpan_rtnl.c
+++ b/net/ieee802154/6lowpan_rtnl.c
@@ -124,7 +124,7 @@ static int lowpan_header_create(struct sk_buff *skb,
        /* if the destination address is the broadcast address, use the
         * corresponding short address
         */
-       if (lowpan_is_addr_broadcast(daddr)) {
+       if (!memcmp(daddr, dev->broadcast, IEEE802154_ADDR_LEN)) {
                da.addr_type = IEEE802154_ADDR_SHORT;
                da.short_addr = IEEE802154_ADDR_BROADCAST;
        } else {
-- 
1.9.0


------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel

Reply via email to