Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 028b2a8c authored by Alexander Aring's avatar Alexander Aring Committed by Marcel Holtmann
Browse files

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: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 6350047e
Loading
Loading
Loading
Loading
+0 −10
Original line number Original line Diff line number Diff line
@@ -74,16 +74,6 @@
					 LOWPAN_IPHC_MAX_HEADER_LEN +	\
					 LOWPAN_IPHC_MAX_HEADER_LEN +	\
					 LOWPAN_NHC_MAX_HDR_LEN)
					 LOWPAN_NHC_MAX_HDR_LEN)


#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_IPV6		0x41 /* 01000001 = 65 */
#define LOWPAN_DISPATCH_IPHC		0x60 /* 011xxxxx = ... */
#define LOWPAN_DISPATCH_IPHC		0x60 /* 011xxxxx = ... */
#define LOWPAN_DISPATCH_IPHC_MASK	0xe0
#define LOWPAN_DISPATCH_IPHC_MASK	0xe0
+1 −1
Original line number Original line Diff line number Diff line
@@ -238,7 +238,7 @@ static int lowpan_header(struct sk_buff *skb, struct net_device *ldev,
	/* if the destination address is the broadcast address, use the
	/* if the destination address is the broadcast address, use the
	 * corresponding short address
	 * corresponding short address
	 */
	 */
	if (lowpan_is_addr_broadcast((const u8 *)daddr)) {
	if (!memcmp(daddr, ldev->broadcast, EUI64_ADDR_LEN)) {
		da.mode = IEEE802154_ADDR_SHORT;
		da.mode = IEEE802154_ADDR_SHORT;
		da.short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST);
		da.short_addr = cpu_to_le16(IEEE802154_ADDR_BROADCAST);
		cb->ackreq = false;
		cb->ackreq = false;