[RFC 1/4] addrconf: Create EUI48 IPv6 addresses for BTLE 6LoWPAN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Create EUI48 IPv6 addresses for 6LoWPAN over Bluetooth Low Energy.
Both IEEE802.15.4 and Bluetooth Low Energy use a netdevice type of
ARPHRD_6LOWPAN, therefore generate the IPv6 address based on the
MAC address length.

Signed-off-by: Patrik Flykt <patrik.flykt@xxxxxxxxxxxxxxx>
---
 net/ipv6/addrconf.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 6c8fc3f..6697fe6 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -2055,6 +2055,10 @@ static int ipv6_generate_eui64(u8 *eui, struct net_device *dev)
 	case ARPHRD_IPGRE:
 		return addrconf_ifid_gre(eui, dev);
 	case ARPHRD_6LOWPAN:
+		/* 6LoWPAN over BTLE */
+		if (dev->addr_len == ETH_ALEN)
+			return addrconf_ifid_eui48(eui, dev);
+
 		return addrconf_ifid_eui64(eui, dev);
 	case ARPHRD_IEEE1394:
 		return addrconf_ifid_ieee1394(eui, dev);
-- 
2.8.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux