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

Commit 688d94fd authored by Josua Mayer's avatar Josua Mayer Committed by Marcel Holtmann
Browse files

Bluetooth: 6lowpan: always check destination address



BLE based 6LoWPAN networks are highly constrained in bandwidth.
Do not take a short-cut, always check if the destination address is
known to belong to a peer.

As a side-effect this also removes any behavioral differences between
one, and two or more connected peers.

Acked-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
Tested-by: default avatarMichael Scott <mike@foundries.io>
Signed-off-by: default avatarJosua Mayer <josua.mayer@jm0.eu>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 5636376c
Loading
Loading
Loading
Loading
+0 −12
Original line number Original line Diff line number Diff line
@@ -168,18 +168,6 @@ static inline struct lowpan_peer *peer_lookup_dst(struct lowpan_btle_dev *dev,


	BT_DBG("peers %d addr %pI6c rt %p", count, daddr, rt);
	BT_DBG("peers %d addr %pI6c rt %p", count, daddr, rt);


	/* If we have multiple 6lowpan peers, then check where we should
	 * send the packet. If only one peer exists, then we can send the
	 * packet right away.
	 */
	if (count == 1) {
		rcu_read_lock();
		peer = list_first_or_null_rcu(&dev->peers, struct lowpan_peer,
					      list);
		rcu_read_unlock();
		return peer;
	}

	if (!rt) {
	if (!rt) {
		if (ipv6_addr_any(&lowpan_cb(skb)->gw)) {
		if (ipv6_addr_any(&lowpan_cb(skb)->gw)) {
			/* There is neither route nor gateway,
			/* There is neither route nor gateway,