All of lore.kernel.org
 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>,
	Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3/3] bluetooth: 6lowpan: always check destination address
Date: Fri,  8 Feb 2019 16:25:19 +0100	[thread overview]
Message-ID: <20190208152519.16181-4-josua.mayer@jm0.eu> (raw)
In-Reply-To: <20190208152519.16181-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.

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 4e14db230793..62b57d3bc0c0 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.20.1


  parent reply	other threads:[~2019-02-08 15:32 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 ` Josua Mayer [this message]
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   ` [PATCH v2 3/3] bluetooth: 6lowpan: always check destination address Josua Mayer
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=20190208152519.16181-4-josua.mayer@jm0.eu \
    --to=josua.mayer@jm0.eu \
    --cc=davem@davemloft.net \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.