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.
This commit is contained in:
Dan Winship
2014-03-26 12:43:24 -04:00
parent 726e84cfbf
commit 4dba720d8c

View File

@@ -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;