Skip to contentSkip to conversation

bluetooth_6lowpan: search for destination address in all peers

RFC New Josua Mayer 1 participant 1 message Jan 10, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 bluetooth_6lowpan: search for destination address in all peers

From: Josua Mayer <[email protected]>

Handle overlooked case where the target address is assigned to a peer and neither route nor gateway exist.

For one peer, no checks are performed to see if it is meant to receive packets for a given address.

As soon as there is a second peer however, checks are performed to deal with routes and gatways for handling complex setups with multiple hops to a target address.
This logic assumed that no route and no gatway imply that the destination address can not be reached, which is false in case of a direct peer.

---
 net/bluetooth/6lowpan.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
net/bluetooth/6lowpan.c +0 -0
index 828e87fe8027..f706b8a13fad 100644
@@ -187,10 +187,16 @@ static inline struct lowpan_peer

*peer_lookup_dst(struct lowpan_btle_dev *dev,
}

if (!rt) {
- nexthop = &lowpan_cb(skb)->gw;
-
- if (ipv6_addr_any(nexthop))
- return NULL;
+ if (ipv6_addr_any(&lowpan_cb(skb)->gw)) {
+ /* There is neither route nor gateway,
+ * probably the destination is a direct peer.
+ */
+ nexthop = daddr;
+ } else {
+ /* There is a known gateway
+ */
+ nexthop = &lowpan_cb(skb)->gw;
+ }
} else {
nexthop = rt6_nexthop(rt, daddr);

Signature · 1 line
2.20.1