mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 20:00:09 +01:00
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:
parent
726e84cfbf
commit
4dba720d8c
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue