linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Josua Mayer <josua.mayer@jm0.eu>
To: linux-bluetooth@vger.kernel.org
Cc: Josua Mayer <josua.mayer@jm0.eu>,
	Jukka Rissanen <jukka.rissanen@linux.intel.com>,
	Michael Scott <mike@foundries.io>,
	Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH v2 3/3] bluetooth: 6lowpan: always check destination address
Date: Tue, 12 Mar 2019 20:16:25 +0100	[thread overview]
Message-ID: <20190312191626.20634-4-josua.mayer@jm0.eu> (raw)
In-Reply-To: <20190312191626.20634-1-josua.mayer@jm0.eu>

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: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Tested-by: Michael Scott <mike@foundries.io>
Signed-off-by: Josua Mayer <josua.mayer@jm0.eu>
---
 net/bluetooth/6lowpan.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index 29a4f3d65348..0f64e9ef1a3a 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -175,18 +175,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);
 
-	/* 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 (ipv6_addr_any(&lowpan_cb(skb)->gw)) {
 			/* There is neither route nor gateway,
-- 
2.21.0


  parent reply	other threads:[~2019-03-12 19:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 15:25 [PATCH 0/3] bluetooth: 6lowpan: multiple peers and addresses Josua Mayer
2019-02-08 15:25 ` [PATCH 1/3] bluetooth: 6lowpan: search for destination address in all peers Josua Mayer
2019-02-08 15:25 ` [PATCH 2/3] bluetooth: 6lowpan: check neighbour table for SLAAC Josua Mayer
2019-03-07 10:41   ` Johan Hedberg
2019-03-12 16:23     ` Josua Mayer
2019-02-08 15:25 ` [PATCH 3/3] bluetooth: 6lowpan: always check destination address Josua Mayer
2019-02-28 20:00 ` [PATCH 0/3] bluetooth: 6lowpan: multiple peers and addresses Josua Mayer
2019-02-28 20:30   ` Michael Scott
2019-03-06 18:10     ` Michael Scott
2019-03-07  9:16       ` Jukka Rissanen
2019-03-12 19:16 ` [PATCH v2 " Josua Mayer
2019-03-12 19:16   ` [PATCH v2 1/3] bluetooth: 6lowpan: search for destination address in all peers Josua Mayer
2019-03-12 19:16   ` [PATCH v2 2/3] bluetooth: 6lowpan: check neighbour table for SLAAC Josua Mayer
2019-03-12 19:16   ` Josua Mayer [this message]
2019-03-30 15:51   ` [PATCH v2 0/3] bluetooth: 6lowpan: multiple peers and addresses Josua Mayer
2019-05-13 10:11   ` [PATCH RESEND v2 1/3] bluetooth: 6lowpan: search for destination address in all peers Josua Mayer
2019-05-13 10:12   ` [PATCH RESEND v2 3/3] bluetooth: 6lowpan: always check destination address Josua Mayer
2019-05-13 10:12   ` [PATCH RESEND v2 2/3] bluetooth: 6lowpan: check neighbour table for SLAAC Josua Mayer
2019-05-13 10:11 ` [PATCH RESEND v2 0/3] bluetooth: 6lowpan: multiple peers and addresses Josua Mayer
2019-07-06 11:11   ` Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190312191626.20634-4-josua.mayer@jm0.eu \
    --to=josua.mayer@jm0.eu \
    --cc=davem@davemloft.net \
    --cc=johan.hedberg@gmail.com \
    --cc=jukka.rissanen@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mike@foundries.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).