diff options
author | Thomas Haller <thaller@redhat.com> | 2016-01-12 14:08:23 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-01-12 14:35:35 +0100 |
commit | 09b8635bd8d80a8843a1e4e828492e4b4acce8f2 (patch) | |
tree | b078cd5b27ba2975b3562b27f8982d1fdd60c45a | |
parent | a6b2747a574e90d7980d0f9ab8e6e73608c0bc2c (diff) | |
download | NetworkManager-09b8635bd8d80a8843a1e4e828492e4b4acce8f2.tar.gz |
fixup! device: detect duplicate IPv4 addresses when method=manual
-rw-r--r-- | src/devices/nm-device.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 674477840f..4cbfa110be 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -6605,7 +6605,7 @@ arp_announce (NMDevice *self) NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); NMConnection *connection; NMSettingIPConfig *s_ip4; - int num, i; + guint num, i; const guint8 *hw_addr; size_t hw_addr_len = 0; @@ -6633,12 +6633,14 @@ arp_announce (NMDevice *self) priv->arping.announcing = nm_arping_manager_new (nm_device_get_ip_ifindex (self)); - for (i = 0; i < nm_setting_ip_config_get_num_addresses (s_ip4); i++) { + for (i = 0; i < num; i++) { NMIPAddress *ip = nm_setting_ip_config_get_address (s_ip4, i); in_addr_t addr; - inet_pton (AF_INET, nm_ip_address_get_address (ip), &addr); - nm_arping_manager_add_address (priv->arping.announcing, addr); + if (inet_pton (AF_INET, nm_ip_address_get_address (ip), &addr) == 1) + nm_arping_manager_add_address (priv->arping.announcing, addr); + else + g_warn_if_reached (); } nm_arping_manager_announce_addresses (priv->arping.announcing); |