All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Aring <aar@pengutronix.de>
To: linux-wpan@vger.kernel.org
Cc: kernel@pengutronix.de, jukka.rissanen@linux.intel.com,
	hannes@stressinduktion.org, stefan@osg.samsung.com,
	mcr@sandelman.ca, werner@almesberger.net,
	Alexander Aring <aar@pengutronix.de>
Subject: [RFCv2 bluetooth-next 03/21] nl802154: avoid address change while running lowpan
Date: Thu,  7 Apr 2016 20:54:04 +0200	[thread overview]
Message-ID: <1460055262-4330-4-git-send-email-aar@pengutronix.de> (raw)
In-Reply-To: <1460055262-4330-1-git-send-email-aar@pengutronix.de>

The generation of autoconfigured IPv6 link-local addresses starts with a
notification on interface up.

To handle autoconfiguration according to RFC 4944 requires pan id and
short address to generate an autoconfigured link-local address. This
patch will avoid changing of these link-layer address configuration
while lowpan interface is up.

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
Signed-off-by: Alexander Aring <aar@pengutronix.de>
---
 net/ieee802154/nl802154.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 16ef0d9..5f1dc4b 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -1074,6 +1074,11 @@ static int nl802154_set_pan_id(struct sk_buff *skb, struct genl_info *info)
 	if (netif_running(dev))
 		return -EBUSY;
 
+	if (wpan_dev->lowpan_dev) {
+		if (netif_running(wpan_dev->lowpan_dev))
+			return -EBUSY;
+	}
+
 	/* don't change address fields on monitor */
 	if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR ||
 	    !info->attrs[NL802154_ATTR_PAN_ID])
@@ -1105,6 +1110,11 @@ static int nl802154_set_short_addr(struct sk_buff *skb, struct genl_info *info)
 	if (netif_running(dev))
 		return -EBUSY;
 
+	if (wpan_dev->lowpan_dev) {
+		if (netif_running(wpan_dev->lowpan_dev))
+			return -EBUSY;
+	}
+
 	/* don't change address fields on monitor */
 	if (wpan_dev->iftype == NL802154_IFTYPE_MONITOR ||
 	    !info->attrs[NL802154_ATTR_SHORT_ADDR])
-- 
2.8.0


  parent reply	other threads:[~2016-04-07 18:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-07 18:54 [RFCv2 bluetooth-next 00/21] 6lowpan: l2 neighbour data and short address Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 01/21] ieee802154: cleanups for ieee802154.h Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 02/21] ieee802154: add short address helpers Alexander Aring
2016-04-07 18:54 ` Alexander Aring [this message]
2016-04-07 18:54 ` [RFCv2 bluetooth-next 04/21] ieee802154: 6lowpan: fix short addr hash Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 05/21] 6lowpan: change naming for lowpan private data Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 06/21] 6lowpan: move lowpan_802154_dev to 6lowpan Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 07/21] 6lowpan: iphc: rename add lowpan prefix Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 08/21] 6lowpan: iphc: remove unnecessary zero data Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 09/21] 6lowpan: move eui64 uncompress function Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 10/21] 6lowpan: add lowpan_is_ll function Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 11/21] 6lowpan: move mac802154 header Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 12/21] 6lowpan: add private neighbour data Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 13/21] 6lowpan: add 802.15.4 short addr slaac Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 14/21] 6lowpan: remove ipv6 module request Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 15/21] ndisc: add addr_len parameter to ndisc_opt_addr_space Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 16/21] ndisc: add addr_len parameter to ndisc_opt_addr_data Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 17/21] ndisc: add addr_len parameter to ndisc_fill_addr_option Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 18/21] ipv6: introduce neighbour discovery ops Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 19/21] ipv6: export ndisc functions Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 20/21] 6lowpan: introduce 6lowpan-nd Alexander Aring
2016-04-07 18:54 ` [RFCv2 bluetooth-next 21/21] 6lowpan: add support for 802.15.4 short addr handling Alexander Aring

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=1460055262-4330-4-git-send-email-aar@pengutronix.de \
    --to=aar@pengutronix.de \
    --cc=hannes@stressinduktion.org \
    --cc=jukka.rissanen@linux.intel.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-wpan@vger.kernel.org \
    --cc=mcr@sandelman.ca \
    --cc=stefan@osg.samsung.com \
    --cc=werner@almesberger.net \
    /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.