Commit 028b2a8c16c7c6a482075fe42275a44fbe5463fa

Authored by Alexander Aring
Committed by Marcel Holtmann
1 parent 6350047eb8

6lowpan: remove lowpan_is_addr_broadcast

This macro is used at 802.15.4 6LoWPAN only and can be replaced by
memcmp with the interface broadcast address.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>

Showing 2 changed files with 1 additions and 11 deletions Side-by-side Diff

include/net/6lowpan.h
... ... @@ -74,16 +74,6 @@
74 74 LOWPAN_IPHC_MAX_HEADER_LEN + \
75 75 LOWPAN_NHC_MAX_HDR_LEN)
76 76  
77   -#define lowpan_is_addr_broadcast(a) \
78   - ((((a)[0]) == 0xFF) && \
79   - (((a)[1]) == 0xFF) && \
80   - (((a)[2]) == 0xFF) && \
81   - (((a)[3]) == 0xFF) && \
82   - (((a)[4]) == 0xFF) && \
83   - (((a)[5]) == 0xFF) && \
84   - (((a)[6]) == 0xFF) && \
85   - (((a)[7]) == 0xFF))
86   -
87 77 #define LOWPAN_DISPATCH_IPV6 0x41 /* 01000001 = 65 */
88 78 #define LOWPAN_DISPATCH_IPHC 0x60 /* 011xxxxx = ... */
89 79 #define LOWPAN_DISPATCH_IPHC_MASK 0xe0
net/ieee802154/6lowpan/tx.c
... ... @@ -238,7 +238,7 @@
238 238 /* if the destination address is the broadcast address, use the
239 239 * corresponding short address
240 240 */
241   - if (lowpan_is_addr_broadcast((const u8 *)daddr)) {
  241 + if (!memcmp(daddr, ldev->broadcast, EUI64_ADDR_LEN)) {
242 242 da.mode = IEEE802154_ADDR_SHORT;
243 243 da.short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST);
244 244 cb->ackreq = false;