summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2014-10-16 15:59:13 -0500
committerDan Williams <dcbw@redhat.com>2015-04-27 14:00:59 -0500
commit4b7015aae8c195a67bc88d5b35743d616a0413ba (patch)
treedbaa1d4c92ec637abbd377b59d6555386b5418e6
parentcb6bafb9af721fcd2295b4da73f4a7812eb4f3e8 (diff)
downloadNetworkManager-4b7015aae8c195a67bc88d5b35743d616a0413ba.tar.gz
core: replace open-coded find_device_by_ip_iface() call in IPv4LL code
The previous code also looked up devices by regular interface, not IP interface, which means that IPv4LL wouldn't have worked on WWAN or ADSL or PPPoE interfaces that might use pppX or nasX. Not that these should use IPv4LL anyway, but we might as well fix it.
-rw-r--r--src/nm-manager.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 7888e68f7c..41088d3e03 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -808,9 +808,7 @@ aipd_handle_event (GDBusProxy *proxy,
gpointer user_data)
{
NMManager *manager = NM_MANAGER (user_data);
- NMManagerPrivate *priv = NM_MANAGER_GET_PRIVATE (manager);
- GSList *iter;
- gboolean handled = FALSE;
+ NMDevice *device;
if ( (strcmp (event, "BIND") != 0)
&& (strcmp (event, "CONFLICT") != 0)
@@ -820,17 +818,10 @@ aipd_handle_event (GDBusProxy *proxy,
return;
}
- for (iter = priv->devices; iter; iter = g_slist_next (iter)) {
- NMDevice *candidate = NM_DEVICE (iter->data);
-
- if (!strcmp (nm_device_get_iface (candidate), iface)) {
- nm_device_handle_autoip4_event (candidate, event, address);
- handled = TRUE;
- break;
- }
- }
-
- if (!handled)
+ device = find_device_by_ip_iface (manager, iface);
+ if (device)
+ nm_device_handle_autoip4_event (device, event, address);
+ else
nm_log_warn (LOGD_AUTOIP4, "(%s): unhandled avahi-autoipd event", iface);
}