2019-07-06 16:02:14

by Ing. Josua Mayer

[permalink] [raw]
Subject: [PATCH v3 0/3] bluetooth: 6lowpan: multiple peers and addresses

From: Josua Mayer <[email protected]>

This patch set deals with an issue I reported earlier this year, where
1) packets addressed to a non-link-local address
2) any packets when at least 2 peers are connected
were not delivered if they matched a direct peer i.e. no routing.

The full explanation of the issue including steps to reproduce are:
https://www.spinics.net/lists/linux-bluetooth/msg78486.html

Changes since v2:
- rebased on bluetooth-next

Changes since v1:
- changed comment style to c++

Josua Mayer (3):
bluetooth: 6lowpan: search for destination address in all peers
bluetooth: 6lowpan: check neighbour table for SLAAC
bluetooth: 6lowpan: always check destination address

net/bluetooth/6lowpan.c | 41 +++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)

--
2.16.4


2019-07-06 16:03:21

by Ing. Josua Mayer

[permalink] [raw]
Subject: [PATCH v3 1/3] 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 gateways for handling complex setups with
multiple hops to a target address.
This logic assumed that no route and no gateway imply that the
destination address can not be reached, which is false in case of a
direct peer.

Acked-by: Jukka Rissanen <[email protected]>
Tested-by: Michael Scott <[email protected]>
Signed-off-by: Josua Mayer <[email protected]>
---
net/bluetooth/6lowpan.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 1555b0c6f7ec..9001bf331d56 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -180,10 +180,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);

--
2.16.4

2019-07-06 19:48:22

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH v3 0/3] bluetooth: 6lowpan: multiple peers and addresses

Hi Josua,

> This patch set deals with an issue I reported earlier this year, where
> 1) packets addressed to a non-link-local address
> 2) any packets when at least 2 peers are connected
> were not delivered if they matched a direct peer i.e. no routing.
>
> The full explanation of the issue including steps to reproduce are:
> https://www.spinics.net/lists/linux-bluetooth/msg78486.html
>
> Changes since v2:
> - rebased on bluetooth-next
>
> Changes since v1:
> - changed comment style to c++
>
> Josua Mayer (3):
> bluetooth: 6lowpan: search for destination address in all peers
> bluetooth: 6lowpan: check neighbour table for SLAAC
> bluetooth: 6lowpan: always check destination address
>
> net/bluetooth/6lowpan.c | 41 +++++++++++++++++++++++++----------------
> 1 file changed, 25 insertions(+), 16 deletions(-)

all 3 patches have been applied to bluetooth-next tree.

Regards

Marcel