From 3db4d3acebc17ba29f303aaaa561271c94372249 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 20 Dec 2018 09:49:56 +0100 Subject: [PATCH] device: fix method check in IPvLL code The check condition was inverted. Anyway, we should receive IPv4LL events only when the method is LINK_LOCAL so turn this into an assertion. Fixes: b16e09a707fd836cf1ea4ed34422158c8408d94f --- src/devices/nm-device.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index f33ede7b90..0bdb7f6bac 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -6805,7 +6805,6 @@ nm_device_handle_ipv4ll_event (sd_ipv4ll *ll, int event, void *data) { NMDevice *self = data; NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); - const char *method; struct in_addr address; NMIP4Config *config; int r; @@ -6813,10 +6812,8 @@ nm_device_handle_ipv4ll_event (sd_ipv4ll *ll, int event, void *data) if (priv->act_request.obj == NULL) return; - /* Ignore if the connection isn't an AutoIP connection */ - method = nm_device_get_effective_ip_config_method (self, AF_INET); - if (nm_streq (method, NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)) - return; + nm_assert (nm_streq (nm_device_get_effective_ip_config_method (self, AF_INET), + NM_SETTING_IP4_CONFIG_METHOD_LINK_LOCAL)); switch (event) { case SD_IPV4LL_EVENT_BIND: