summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/devices/nm-device-ethernet.c7
-rw-r--r--src/devices/nm-device-vlan.c3
-rw-r--r--src/devices/wifi/nm-device-wifi.c3
3 files changed, 9 insertions, 4 deletions
diff --git a/src/devices/nm-device-ethernet.c b/src/devices/nm-device-ethernet.c
index f103c915e3..ac408d3d9f 100644
--- a/src/devices/nm-device-ethernet.c
+++ b/src/devices/nm-device-ethernet.c
@@ -265,7 +265,9 @@ constructor (GType type,
int ifindex = nm_device_get_ifindex (NM_DEVICE (object));
NMLinkType link_type = nm_platform_link_get_type (ifindex);
- g_assert (link_type == NM_LINK_TYPE_ETHERNET || link_type == NM_LINK_TYPE_VETH);
+ g_assert ( link_type == NM_LINK_TYPE_ETHERNET
+ || link_type == NM_LINK_TYPE_VETH
+ || link_type == NM_LINK_TYPE_NONE);
#endif
/* s390 stuff */
@@ -1389,7 +1391,8 @@ deactivate (NMDevice *device)
NM_DEVICE_ETHERNET_GET_PRIVATE (device)->last_pppoe_time = nm_utils_get_monotonic_timestamp_s ();
/* Reset MAC address back to initial address */
- nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_ETHER);
+ if (priv->initial_hw_addr)
+ nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_ETHER);
}
static gboolean
diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c
index a245a434b2..c69bcdedde 100644
--- a/src/devices/nm-device-vlan.c
+++ b/src/devices/nm-device-vlan.c
@@ -390,7 +390,8 @@ deactivate (NMDevice *device)
NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (self);
/* Reset MAC address back to initial address */
- nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_VLAN);
+ if (priv->initial_hw_addr)
+ nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_VLAN);
}
/******************************************************************/
diff --git a/src/devices/wifi/nm-device-wifi.c b/src/devices/wifi/nm-device-wifi.c
index 440f1225dd..dd7754b33e 100644
--- a/src/devices/wifi/nm-device-wifi.c
+++ b/src/devices/wifi/nm-device-wifi.c
@@ -741,7 +741,8 @@ deactivate (NMDevice *device)
nm_platform_wifi_indicate_addressing_running (ifindex, FALSE);
/* Reset MAC address back to initial address */
- nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_WIFI);
+ if (priv->initial_hw_addr)
+ nm_device_set_hw_addr (device, priv->initial_hw_addr, "reset", LOGD_WIFI);
/* Ensure we're in infrastructure mode after deactivation; some devices
* (usually older ones) don't scan well in adhoc mode.