From 1d396e9972218f52a7ddce1ba8b362eb9cfdf15e Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Wed, 23 May 2018 11:03:05 +0200 Subject: [PATCH] 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. --- src/nm-core-utils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index 71370985b..50e107ecd 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