summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2018-05-23 11:03:05 +0200
committerLubomir Rintel <lkundrak@v3.sk>2018-06-26 16:21:55 +0200
commit1d396e9972218f52a7ddce1ba8b362eb9cfdf15e (patch)
treec3955ae613b4a266b5b31a10e97b41ec64b8a425
parent5da77c0e2c032af52904c9ce4fb9906ac577a35e (diff)
downloadNetworkManager-1d396e9972218f52a7ddce1ba8b362eb9cfdf15e.tar.gz
core-utils: use 64-bit WPAN address for a 6LoWPAN IID
If the hardware address is a 64-bit value it can be used directly as an IEEE EUI-64 address when generating an interface identifier.
-rw-r--r--src/nm-core-utils.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c
index 71370985b2..50e107ecda 100644
--- a/src/nm-core-utils.c
+++ b/src/nm-core-utils.c
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright 2004 - 2014 Red Hat, Inc.
+ * Copyright 2004 - 2018 Red Hat, Inc.
* Copyright 2005 - 2008 Novell, Inc.
*/
@@ -3018,6 +3018,11 @@ nm_utils_get_ipv6_interface_identifier (NMLinkType link_type,
out_iid->id_u8[3] = 0xFE;
memcpy (out_iid->id_u8 + 4, &addr, 4);
return TRUE;
+ case NM_LINK_TYPE_6LOWPAN:
+ /* The hardware address is already 64-bit. This is the case for
+ * IEEE 802.15.4 networks. */
+ memcpy (out_iid->id_u8, hwaddr, sizeof (out_iid->id_u8));
+ return TRUE;
default:
if (hwaddr_len == ETH_ALEN) {
/* Translate 48-bit MAC address to a 64-bit Modified EUI-64. See