Linux bluetooth development
 help / color / mirror / Atom feed
From: Jukka Rissanen <jukka.rissanen@linux.intel.com>
To: linux-bluetooth@vger.kernel.org
Subject: [RFC v2 2/7] ipv6: Add checks for RAWIP ARP type
Date: Wed, 30 Oct 2013 11:00:56 +0200	[thread overview]
Message-ID: <1383123661-15087-3-git-send-email-jukka.rissanen@linux.intel.com> (raw)
In-Reply-To: <1383123661-15087-1-git-send-email-jukka.rissanen@linux.intel.com>

Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
---
 net/ipv6/addrconf.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index d6ff126..60bf947 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -1783,6 +1783,15 @@ static int addrconf_ifid_ip6tnl(u8 *eui, struct net_device *dev)
 	return 0;
 }
 
+static int addrconf_ifid_rawip(u8 *eui, struct net_device *dev)
+{
+	if (dev->addr_len != 8)
+		return -1;
+	memcpy(eui, dev->dev_addr, 8);
+	eui[0] ^= 2;
+	return 0;
+}
+
 static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
 {
 	switch (dev->type) {
@@ -1803,6 +1812,8 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
 		return addrconf_ifid_ieee1394(eui, dev);
 	case ARPHRD_TUNNEL6:
 		return addrconf_ifid_ip6tnl(eui, dev);
+	case ARPHRD_RAWIP:
+		return addrconf_ifid_rawip(eui, dev);
 	}
 	return -1;
 }
@@ -2681,7 +2692,8 @@ static void addrconf_dev_config(struct net_device *dev)
 	    (dev->type != ARPHRD_INFINIBAND) &&
 	    (dev->type != ARPHRD_IEEE802154) &&
 	    (dev->type != ARPHRD_IEEE1394) &&
-	    (dev->type != ARPHRD_TUNNEL6)) {
+	    (dev->type != ARPHRD_TUNNEL6) &&
+	    (dev->type != ARPHRD_RAWIP)) {
 		/* Alas, we support only Ethernet autoconfiguration. */
 		return;
 	}
-- 
1.7.11.7


  parent reply	other threads:[~2013-10-30  9:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30  9:00 [RFC v2 0/7] Bluetooth LE 6LoWPAN Jukka Rissanen
2013-10-30  9:00 ` [RFC v2 1/7] net: if_arp: add ARPHRD_RAWIP type Jukka Rissanen
2013-10-30  9:00 ` Jukka Rissanen [this message]
2013-10-30  9:00 ` [RFC v2 3/7] Bluetooth: Initial skeleton code for BT 6LoWPAN Jukka Rissanen
2013-10-30 12:02   ` Marcel Holtmann
2013-10-30  9:00 ` [RFC v2 4/7] Bluetooth: Enable 6LoWPAN support for BT LE devices Jukka Rissanen
2013-10-30 12:11   ` Marcel Holtmann
2013-10-30  9:00 ` [RFC v2 5/7] route: Exporting ip6_route_add() so that Bluetooth 6LoWPAN can use it Jukka Rissanen
2013-10-30  9:01 ` [RFC v2 6/7] Bluetooth: Set route to peer for 6LoWPAN Jukka Rissanen
2013-10-30  9:01 ` [RFC v2 7/7] Bluetooth: Manually enable or disable 6LoWPAN between devices Jukka Rissanen
2013-10-30 12:10   ` 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=1383123661-15087-3-git-send-email-jukka.rissanen@linux.intel.com \
    --to=jukka.rissanen@linux.intel.com \
    --cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox