summaryrefslogtreecommitdiff
path: root/src/devices/nm-device-vlan.c
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2014-12-01 16:53:12 +0100
committerLubomir Rintel <lkundrak@v3.sk>2014-12-02 11:44:49 +0100
commite257744f9ed397b06cbcc2944527221a1a09d92f (patch)
treed980157601c1eb49af69bf33ad840a7a3558f2b2 /src/devices/nm-device-vlan.c
parent20566c76de0d18162af020852ae1e2055addcfff (diff)
downloadNetworkManager-e257744f9ed397b06cbcc2944527221a1a09d92f.tar.gz
device: Deal with links that vanish during initialization
nm_device_get_hw_address() may return NULL and nm_platform_link_get_type may return NM_LINK_TYPE_NONE. While it might be a good idea to check for such cases at the init time it seems easier to just ignore it and prevent blowing up in subsequent deactivation. A quick test case: # while :; do ip link add moo0 type veth peer moo1; ip link del moo0 ; done Yields: NetworkManager:ERROR:devices/nm-device-ethernet.c:268:constructor: assertion failed: (link_type == NM_LINK_TYPE_ETHERNET || link_type == NM_LINK_TYPE_VETH) nm_device_set_hw_addr: assertion 'addr != NULL' failed https://bugzilla.gnome.org/show_bug.cgi?id=740992
Diffstat (limited to 'src/devices/nm-device-vlan.c')
-rw-r--r--src/devices/nm-device-vlan.c3
1 files changed, 2 insertions, 1 deletions
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);
}
/******************************************************************/