summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-03-26 12:43:24 -0400
committerDan Winship <danw@gnome.org>2014-03-26 12:56:57 -0400
commit4dba720d8c883549e57a292a236c8ea44e1e0bca (patch)
treea45660cc3dbf2ae848737ec7fbeff834ddfdde65
parent726e84cfbfc7531924afa26d5abe6349d0dd69bb (diff)
downloadNetworkManager-4dba720d8c883549e57a292a236c8ea44e1e0bca.tar.gz
platform: fix handling of labels
If an address has a label without a ':' in it (eg, its label is just $DEVICE, not $DEVICE:$NUM), then ignore it.
-rw-r--r--src/platform/nm-linux-platform.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c
index 252d30d197..d52ebfaf3a 100644
--- a/src/platform/nm-linux-platform.c
+++ b/src/platform/nm-linux-platform.c
@@ -892,7 +892,8 @@ init_ip4_address (NMPlatformIP4Address *address, struct rtnl_addr *rtnladdr)
memcpy (&address->peer_address, nl_addr_get_binary_addr (nlpeer), sizeof (address->peer_address));
}
label = rtnl_addr_get_label (rtnladdr);
- if (label && *label)
+ /* Check for ':'; we're only interested in labels used as interface aliases */
+ if (label && strchr (label, ':'))
g_strlcpy (address->label, label, sizeof (address->label));
return TRUE;