summary refs log tree commit diff
path: root/src/devices
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices')
-rw-r--r--src/devices/adsl/Makefile.am1
-rw-r--r--src/devices/adsl/Makefile.in1
-rw-r--r--src/devices/bluetooth/Makefile.am1
-rw-r--r--src/devices/bluetooth/Makefile.in3
-rw-r--r--src/devices/nm-device-bond.c52
-rw-r--r--src/devices/nm-device-factory.c19
-rw-r--r--src/devices/nm-device.c166
-rw-r--r--src/devices/nm-device.h108
-rw-r--r--src/devices/nm-lldp-listener.c39
-rw-r--r--src/devices/team/Makefile.am1
-rw-r--r--src/devices/team/Makefile.in3
-rw-r--r--src/devices/tests/Makefile.am1
-rw-r--r--src/devices/tests/Makefile.in1
-rw-r--r--src/devices/tests/test-lldp.c11
-rw-r--r--src/devices/wifi/Makefile.am1
-rw-r--r--src/devices/wifi/Makefile.in1
-rw-r--r--src/devices/wifi/tests/Makefile.am1
-rw-r--r--src/devices/wifi/tests/Makefile.in1
-rw-r--r--src/devices/wwan/Makefile.am1
-rw-r--r--src/devices/wwan/Makefile.in1
20 files changed, 242 insertions, 171 deletions
diff --git a/src/devices/adsl/Makefile.am b/src/devices/adsl/Makefile.am
index e7034fa8..5f981740 100644
--- a/src/devices/adsl/Makefile.am
+++ b/src/devices/adsl/Makefile.am
@@ -14,7 +14,6 @@ AM_CPPFLAGS = \
 	-I${top_srcdir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-adsl"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GUDEV_CFLAGS)
 
 pkglib_LTLIBRARIES = libnm-device-plugin-adsl.la
diff --git a/src/devices/adsl/Makefile.in b/src/devices/adsl/Makefile.in
index e969a627..c8549200 100644
--- a/src/devices/adsl/Makefile.in
+++ b/src/devices/adsl/Makefile.in
@@ -493,7 +493,6 @@ AM_CPPFLAGS = \
 	-I${top_srcdir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-adsl"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GUDEV_CFLAGS)
 
 pkglib_LTLIBRARIES = libnm-device-plugin-adsl.la
diff --git a/src/devices/bluetooth/Makefile.am b/src/devices/bluetooth/Makefile.am
index 2054ea0f..2ff9a572 100644
--- a/src/devices/bluetooth/Makefile.am
+++ b/src/devices/bluetooth/Makefile.am
@@ -16,7 +16,6 @@ AM_CPPFLAGS = \
 	-I${top_srcdir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-bluetooth"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS)
 
 GLIB_GENERATED = nm-bt-enum-types.h nm-bt-enum-types.c
diff --git a/src/devices/bluetooth/Makefile.in b/src/devices/bluetooth/Makefile.in
index f93f7242..233ad9e8 100644
--- a/src/devices/bluetooth/Makefile.in
+++ b/src/devices/bluetooth/Makefile.in
@@ -510,8 +510,7 @@ AM_CPPFLAGS = -I${top_srcdir}/src -I${top_builddir}/src \
 	-I${top_srcdir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-bluetooth"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE $(GLIB_CFLAGS) \
-	$(am__append_1)
+	$(GLIB_CFLAGS) $(am__append_1)
 GLIB_GENERATED = nm-bt-enum-types.h nm-bt-enum-types.c
 GLIB_MKENUMS_H_FLAGS = --identifier-prefix NM
 GLIB_MKENUMS_C_FLAGS = --identifier-prefix NM
diff --git a/src/devices/nm-device-bond.c b/src/devices/nm-device-bond.c
index b88b2511..6ae29b9c 100644
--- a/src/devices/nm-device-bond.c
+++ b/src/devices/nm-device-bond.c
@@ -160,16 +160,23 @@ update_connection (NMDevice *device, NMConnection *connection)
 	while (options && *options) {
 		gs_free char *value = nm_platform_sysctl_master_get_option (NM_PLATFORM_GET, ifindex, *options);
 		const char *defvalue = nm_setting_bond_get_option_default (s_bond, *options);
+		char *p;
 
-		if (value && !ignore_if_zero (*options, value) && (g_strcmp0 (value, defvalue) != 0)) {
+		if (_nm_setting_bond_get_option_type (s_bond, *options) == NM_BOND_OPTION_TYPE_BOTH) {
+			p = strchr (value, ' ');
+			if (p)
+				*p = '\0';
+		}
+
+		if (   value
+		    && value[0]
+		    && !ignore_if_zero (*options, value)
+		    && !nm_streq0 (value, defvalue)) {
 			/* Replace " " with "," for arp_ip_targets from the kernel */
 			if (strcmp (*options, "arp_ip_target") == 0) {
-				char *p = value;
-
-				while (p && *p) {
+				for (p = value; *p; p++) {
 					if (*p == ' ')
 						*p = ',';
-					p++;
 				}
 			}
 
@@ -285,7 +292,7 @@ apply_bonding_config (NMDevice *device)
 	set_bond_attr (device, "mode", mode);
 
 	/* arp_interval not compatible with ALB, TLB */
-	if (g_strcmp0 (mode, "balance-alb") == 0 || g_strcmp0 (mode, "balance-tlb") == 0)
+	if (NM_IN_STRSET (mode, "balance-alb", "balance-tlb"))
 		set_arp_interval = FALSE;
 
 	if (set_arp_interval) {
@@ -299,18 +306,17 @@ apply_bonding_config (NMDevice *device)
 	value = nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_ARP_VALIDATE);
 	/* arp_validate > 0 only valid in active-backup mode */
 	if (   value
-	    && g_strcmp0 (value, "0") != 0
-	    && g_strcmp0 (value, "none") != 0
-	    && g_strcmp0 (mode, "active-backup") == 0)
+	    && !nm_streq (value, "0")
+	    && !nm_streq (value, "none")
+	    && nm_streq (mode, "active-backup"))
 		set_bond_attr (device, "arp_validate", value);
 	else
 		set_bond_attr (device, "arp_validate", "0");
 
-	if (   g_strcmp0 (mode, "active-backup") == 0
-	    || g_strcmp0 (mode, "balance-alb") == 0
-	    || g_strcmp0 (mode, "balance-tlb") == 0) {
+	if (NM_IN_STRSET (mode, "active-backup", "balance-alb", "balance-tlb")) {
 		value = nm_setting_bond_get_option_by_name (s_bond, NM_SETTING_BOND_OPTION_PRIMARY);
 		set_bond_attr (device, "primary", value ? value : "");
+		set_simple_option (device, "lp_internal", s_bond, NM_SETTING_BOND_OPTION_LP_INTERVAL);
 	}
 
 	/* Clear ARP targets */
@@ -328,15 +334,31 @@ apply_bonding_config (NMDevice *device)
 	set_simple_option (device, "ad_select", s_bond, NM_SETTING_BOND_OPTION_AD_SELECT);
 	set_simple_option (device, "xmit_hash_policy", s_bond, NM_SETTING_BOND_OPTION_XMIT_HASH_POLICY);
 	set_simple_option (device, "resend_igmp", s_bond, NM_SETTING_BOND_OPTION_RESEND_IGMP);
+	set_simple_option (device, "active_slave", s_bond, NM_SETTING_BOND_OPTION_ACTIVE_SLAVE);
+	set_simple_option (device, "all_slaves_active", s_bond, NM_SETTING_BOND_OPTION_ALL_SLAVES_ACTIVE);
+	set_simple_option (device, "num_grat_arp", s_bond, NM_SETTING_BOND_OPTION_NUM_GRAT_ARP);
+	set_simple_option (device, "num_unsol_na", s_bond, NM_SETTING_BOND_OPTION_NUM_UNSOL_NA);
 
-	if (   g_strcmp0 (mode, "4") == 0
-	    || g_strcmp0 (mode, "802.3ad") == 0)
+	if (nm_streq (mode, "802.3ad")) {
 		set_simple_option (device, "lacp_rate", s_bond, NM_SETTING_BOND_OPTION_LACP_RATE);
+		set_simple_option (device, "ad_actor_sys_prio", s_bond, NM_SETTING_BOND_OPTION_AD_ACTOR_SYS_PRIO);
+		set_simple_option (device, "ad_actor_system", s_bond, NM_SETTING_BOND_OPTION_AD_ACTOR_SYSTEM);
+		set_simple_option (device, "ad_user_port_key", s_bond, NM_SETTING_BOND_OPTION_AD_USER_PORT_KEY);
+		set_simple_option (device, "min_links", s_bond, NM_SETTING_BOND_OPTION_MIN_LINKS);
+	}
+
+	if (nm_streq (mode, "active-backup"))
+		set_simple_option (device, "arp_all_targets", s_bond, NM_SETTING_BOND_OPTION_ARP_ALL_TARGETS);
+
+	if (nm_streq (mode, "balance-rr"))
+		set_simple_option (device, "packets_per_slave", s_bond, NM_SETTING_BOND_OPTION_PACKETS_PER_SLAVE);
+
+	if (nm_streq (mode, "balance-tlb"))
+		set_simple_option (device, "tlb_dynamic_lb", s_bond, NM_SETTING_BOND_OPTION_TLB_DYNAMIC_LB);
 
 	return NM_ACT_STAGE_RETURN_SUCCESS;
 }
 
-
 static NMActStageReturn
 act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason)
 {
diff --git a/src/devices/nm-device-factory.c b/src/devices/nm-device-factory.c
index 5ce4333f..9dfa9bcb 100644
--- a/src/devices/nm-device-factory.c
+++ b/src/devices/nm-device-factory.c
@@ -91,6 +91,8 @@ nm_device_factory_create_device (NMDeviceFactory *factory,
 	const NMLinkType *link_types = NULL;
 	const char **setting_types = NULL;
 	int i;
+	NMDevice *device;
+	gboolean ignore = FALSE;
 
 	g_return_val_if_fail (factory, NULL);
 	g_return_val_if_fail (iface && *iface, NULL);
@@ -99,6 +101,8 @@ nm_device_factory_create_device (NMDeviceFactory *factory,
 
 	nm_device_factory_get_supported_types (factory, &link_types, &setting_types);
 
+	NM_SET_OUT (out_ignore, FALSE);
+
 	if (plink) {
 		g_return_val_if_fail (strcmp (iface, plink->name) == 0, NULL);
 
@@ -137,7 +141,20 @@ nm_device_factory_create_device (NMDeviceFactory *factory,
 		return NULL;
 	}
 
-	return interface->create_device (factory, iface, plink, connection, out_ignore);
+	device = interface->create_device (factory, iface, plink, connection, &ignore);
+	NM_SET_OUT (out_ignore, ignore);
+	if (!device) {
+		if (ignore) {
+			g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
+			             "Device factory %s ignores device %s",
+			             G_OBJECT_TYPE_NAME (factory), iface);
+		} else {
+			g_set_error (error, NM_MANAGER_ERROR, NM_MANAGER_ERROR_FAILED,
+			             "Device factory %s failed to create device %s",
+			             G_OBJECT_TYPE_NAME (factory), iface);
+		}
+	}
+	return device;
 }
 
 const char *
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 529b3cd8..dde9af94 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -1195,17 +1195,67 @@ nm_device_master_release_one_slave (NMDevice *self, NMDevice *slave, gboolean co
 static gboolean
 can_unmanaged_external_down (NMDevice *self)
 {
-	return nm_device_is_software (self) && !NM_DEVICE_GET_PRIVATE (self)->is_nm_owned;
+	return    !NM_DEVICE_GET_PRIVATE (self)->is_nm_owned
+	       && nm_device_is_software (self);
 }
 
-static void
-update_dynamic_ip_setup (NMDevice *self)
+static NMUnmanFlagOp
+is_unmanaged_external_down (NMDevice *self, gboolean consider_can)
 {
 	NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
+
+	if (   consider_can
+	    && !NM_DEVICE_GET_CLASS (self)->can_unmanaged_external_down (self))
+		return NM_UNMAN_FLAG_OP_FORGET;
+
+	/* Manage externally-created software interfaces only when they are IFF_UP */
+	if (   priv->ifindex <= 0
+	    || !priv->up
+	    || !nm_platform_link_can_assume (NM_PLATFORM_GET, priv->ifindex))
+		return NM_UNMAN_FLAG_OP_SET_UNMANAGED;
+
+	return NM_UNMAN_FLAG_OP_SET_MANAGED;
+}
+
+static void
+set_unmanaged_external_down (NMDevice *self, gboolean only_if_unmanaged)
+{
+	NMUnmanFlagOp ext_flags;
+
+	if (!nm_device_get_unmanaged_mask (self, NM_UNMANAGED_EXTERNAL_DOWN))
+		return;
+
+	if (only_if_unmanaged) {
+		if (!nm_device_get_unmanaged_flags (self, NM_UNMANAGED_EXTERNAL_DOWN))
+			return;
+	}
+
+	ext_flags = is_unmanaged_external_down (self, FALSE);
+	if (ext_flags != NM_UNMAN_FLAG_OP_SET_UNMANAGED) {
+		/* Ensure the assume check is queued before any queued state changes
+		 * from the transition to UNAVAILABLE.
+		 */
+		nm_device_queue_recheck_assume (self);
+	}
+
+	nm_device_set_unmanaged_by_flags (self,
+	                                  NM_UNMANAGED_EXTERNAL_DOWN,
+	                                  ext_flags,
+	                                  NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
+}
+
+void
+nm_device_update_dynamic_ip_setup (NMDevice *self)
+{
+	NMDevicePrivate *priv;
 	GError *error;
 	gconstpointer addr;
 	size_t addr_length;
 
+	g_return_if_fail (NM_IS_DEVICE (self));
+
+	priv = NM_DEVICE_GET_PRIVATE (self);
+
 	g_hash_table_remove_all (priv->ip6_saved_properties);
 
 	if (priv->dhcp4_client) {
@@ -1295,7 +1345,7 @@ carrier_changed (NMDevice *self, gboolean carrier)
 			 * tagged for carrier ignore) ensure that when the carrier appears we
 			 * renew DHCP leases and such.
 			 */
-			update_dynamic_ip_setup (self);
+			nm_device_update_dynamic_ip_setup (self);
 		}
 	} else {
 		if (priv->state == NM_DEVICE_STATE_UNAVAILABLE) {
@@ -1422,7 +1472,6 @@ device_link_changed (NMDevice *self)
 	NMPlatformLink info;
 	const NMPlatformLink *pllink;
 	int ifindex;
-	gboolean was_up;
 
 	priv->device_link_changed_id = 0;
 
@@ -1493,25 +1542,21 @@ device_link_changed (NMDevice *self)
 
 	/* Update DHCP, etc, if needed */
 	if (ip_ifname_changed)
-		update_dynamic_ip_setup (self);
+		nm_device_update_dynamic_ip_setup (self);
 
-	was_up = priv->up;
 	priv->up = NM_FLAGS_HAS (info.n_ifi_flags, IFF_UP);
 
-	if (   priv->ifindex > 0
-	    && info.initialized
+	if (   info.initialized
 	    && nm_device_get_unmanaged_flags (self, NM_UNMANAGED_PLATFORM_INIT)) {
 		NMDeviceStateReason reason;
 
 		nm_device_set_unmanaged_by_user_udev (self);
 
-		/* If the devices that need an external IFF_UP go managed below,
-		 * it means they're already up. In that case we should use an "assumed"
-		 * reason to prevent the cleanup sequence from being run on transition
-		 * from "unmanaged" to "unavailable". */
-		if (   priv->up
-		    && !nm_device_get_unmanaged_flags (self, NM_UNMANAGED_EXTERNAL_DOWN)
-		    && NM_DEVICE_GET_CLASS (self)->can_unmanaged_external_down (self)) {
+		/* If the device is a external-down candidated but no longer has external
+		 * down set, we must clear the platform-unmanaged flag with reason
+		 * "assumed". */
+		if (    nm_device_get_unmanaged_mask (self, NM_UNMANAGED_EXTERNAL_DOWN)
+		    && !nm_device_get_unmanaged_flags (self, NM_UNMANAGED_EXTERNAL_DOWN)) {
 			/* Ensure the assume check is queued before any queued state changes
 			 * from the transition to UNAVAILABLE.
 			 */
@@ -1523,35 +1568,7 @@ device_link_changed (NMDevice *self)
 		nm_device_set_unmanaged_by_flags (self, NM_UNMANAGED_PLATFORM_INIT, FALSE, reason);
 	}
 
-	if (   priv->ifindex > 0
-	    && priv->up != was_up
-	    && NM_DEVICE_GET_CLASS (self)->can_unmanaged_external_down (self)) {
-		/* Manage externally-created software interfaces only when they are IFF_UP */
-		if (   priv->up
-		    && nm_device_get_unmanaged_flags (self, NM_UNMANAGED_EXTERNAL_DOWN)) {
-			/* Ensure the assume check is queued before any queued state changes
-			 * from the transition to UNAVAILABLE.
-			 */
-			nm_device_queue_recheck_assume (self);
-		}
-
-		/* In case of @priv->up, resetting the EXTERNAL_DOWN flag may change the device's
-		 * state to UNAVAILABLE. To ensure that the state change doesn't touch
-		 * the device before assumption occurs, pass NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED
-		 * as the reason.
-		 *
-		 * In case of !@priv->up, and the device is already unmanaged for other reasons, the
-		 * state-change-reason has no effect.
-		 * If the device is managed for an explict user-request, the state-change-reason
-		 * also has no effect, because the device stays managed.
-		 *
-		 * The state-change-reason only has effect if the device was assumed
-		 * and is now to be unmanaged. */
-		nm_device_set_unmanaged_by_flags (self,
-		                                  NM_UNMANAGED_EXTERNAL_DOWN,
-		                                  !priv->up,
-		                                  NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
-	}
+	set_unmanaged_external_down (self, FALSE);
 
 	device_recheck_slave_status (self, &info);
 	return G_SOURCE_REMOVE;
@@ -1580,7 +1597,7 @@ device_ip_link_changed (NMDevice *self)
 		priv->ip_iface = g_strdup (pllink->name);
 
 		_notify (self, PROP_IP_IFACE);
-		update_dynamic_ip_setup (self);
+		nm_device_update_dynamic_ip_setup (self);
 	}
 	return G_SOURCE_REMOVE;
 }
@@ -1921,12 +1938,11 @@ realize_start_setup (NMDevice *self, const NMPlatformLink *plink)
 
 	klass->realize_start_notify (self, plink);
 
-	/* Do not manage externally created software devices until they are IFF_UP */
-	if (   priv->ifindex > 0
-	    && plink
-	    && !priv->up
-	    && NM_DEVICE_GET_CLASS (self)->can_unmanaged_external_down (self))
-		nm_device_set_unmanaged_flags (self, NM_UNMANAGED_EXTERNAL_DOWN, TRUE);
+	/* Do not manage externally created software devices until they are IFF_UP
+	 * or have IP addressing */
+	nm_device_set_unmanaged_flags (self,
+	                               NM_UNMANAGED_EXTERNAL_DOWN,
+	                               is_unmanaged_external_down (self, TRUE));
 
 	/* Unmanaged the loopback device with an explicit NM_UNMANAGED_LOOPBACK flag.
 	 * Later we might want to manage 'lo' too. Currently that doesn't work because
@@ -2569,6 +2585,18 @@ nm_device_removed (NMDevice *self)
 		 * Release the slave from master, but don't touch the device. */
 		nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
 	}
+
+	/* Clean up IP configs; this does not actually deconfigure the
+	 * interface, it just clears the configuration to which policy
+	 * is reacting via NM_DEVICE_IP4_CONFIG_CHANGED/NM_DEVICE_IP6_CONFIG_CHANGED
+	 * signal. As NMPolicy registered the NMIPxConfig instances in NMDnsManager,
+	 * these would be leaked otherwise. */
+	priv->default_route.v4_has = FALSE;
+	priv->default_route.v4_is_assumed = TRUE;
+	nm_device_set_ip4_config (self, NULL, 0, FALSE, FALSE, NULL);
+	priv->default_route.v6_has = FALSE;
+	priv->default_route.v6_is_assumed = TRUE;
+	nm_device_set_ip6_config (self, NULL, FALSE, FALSE, NULL);
 }
 
 static gboolean
@@ -3050,8 +3078,7 @@ nm_device_check_slave_connection_compatible (NMDevice *self, NMConnection *slave
 static gboolean
 nm_device_can_assume_connections (NMDevice *self)
 {
-	return   !!NM_DEVICE_GET_CLASS (self)->update_connection
-	      && !NM_DEVICE_GET_PRIVATE (self)->is_nm_owned;
+	return   !!NM_DEVICE_GET_CLASS (self)->update_connection;
 }
 
 /**
@@ -8869,6 +8896,8 @@ queued_ip4_config_change (gpointer user_data)
 	update_ip4_config (self, FALSE);
 	g_object_unref (self);
 
+	set_unmanaged_external_down (self, TRUE);
+
 	return FALSE;
 }
 
@@ -8923,6 +8952,8 @@ queued_ip6_config_change (gpointer user_data)
 
 	g_object_unref (self);
 
+	set_unmanaged_external_down (self, TRUE);
+
 	return FALSE;
 }
 
@@ -9124,6 +9155,24 @@ nm_device_get_managed (NMDevice *self, gboolean for_user_request)
 }
 
 /**
+ * nm_device_get_unmanaged_mask:
+ * @self: the #NMDevice
+ * @flag: the unmanaged flags to check.
+ *
+ * Return the unmanaged flags mask set on this device.
+ *
+ * Returns: the flags of the device ( & @flag)
+ */
+NMUnmanagedFlags
+nm_device_get_unmanaged_mask (NMDevice *self, NMUnmanagedFlags flag)
+{
+	g_return_val_if_fail (NM_IS_DEVICE (self), NM_UNMANAGED_NONE);
+	g_return_val_if_fail (flag != NM_UNMANAGED_NONE, NM_UNMANAGED_NONE);
+
+	return NM_DEVICE_GET_PRIVATE (self)->unmanaged_mask & flag;
+}
+
+/**
  * nm_device_get_unmanaged_flags:
  * @self: the #NMDevice
  * @flag: the unmanaged flags to check.
@@ -9135,8 +9184,8 @@ nm_device_get_managed (NMDevice *self, gboolean for_user_request)
 NMUnmanagedFlags
 nm_device_get_unmanaged_flags (NMDevice *self, NMUnmanagedFlags flag)
 {
-	g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
-	g_return_val_if_fail (flag != NM_UNMANAGED_NONE, FALSE);
+	g_return_val_if_fail (NM_IS_DEVICE (self), NM_UNMANAGED_NONE);
+	g_return_val_if_fail (flag != NM_UNMANAGED_NONE, NM_UNMANAGED_NONE);
 
 	return NM_DEVICE_GET_PRIVATE (self)->unmanaged_flags & flag;
 }
@@ -9943,7 +9992,6 @@ static void
 _cleanup_generic_post (NMDevice *self, CleanupType cleanup_type)
 {
 	NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
-	NMDeviceStateReason ignored = NM_DEVICE_STATE_REASON_NONE;
 
 	priv->default_route.v4_has = FALSE;
 	priv->default_route.v6_has = FALSE;
@@ -9968,8 +10016,8 @@ _cleanup_generic_post (NMDevice *self, CleanupType cleanup_type)
 	/* Clean up IP configs; this does not actually deconfigure the
 	 * interface; the caller must flush routes and addresses explicitly.
 	 */
-	nm_device_set_ip4_config (self, NULL, 0, TRUE, TRUE, &ignored);
-	nm_device_set_ip6_config (self, NULL, TRUE, TRUE, &ignored);
+	nm_device_set_ip4_config (self, NULL, 0, TRUE, TRUE, NULL);
+	nm_device_set_ip6_config (self, NULL, TRUE, TRUE, NULL);
 	g_clear_object (&priv->con_ip4_config);
 	g_clear_object (&priv->dev_ip4_config);
 	g_clear_object (&priv->ext_ip4_config);
diff --git a/src/devices/nm-device.h b/src/devices/nm-device.h
index bd657e68..368e77f7 100644
--- a/src/devices/nm-device.h
+++ b/src/devices/nm-device.h
@@ -86,12 +86,12 @@
 
 G_BEGIN_DECLS
 
-#define NM_TYPE_DEVICE			(nm_device_get_type ())
-#define NM_DEVICE(obj)			(G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE, NMDevice))
-#define NM_DEVICE_CLASS(klass)	(G_TYPE_CHECK_CLASS_CAST ((klass),  NM_TYPE_DEVICE, NMDeviceClass))
-#define NM_IS_DEVICE(obj)		(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE))
-#define NM_IS_DEVICE_CLASS(klass)	(G_TYPE_CHECK_CLASS_TYPE ((klass),  NM_TYPE_DEVICE))
-#define NM_DEVICE_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj),  NM_TYPE_DEVICE, NMDeviceClass))
+#define NM_TYPE_DEVICE            (nm_device_get_type ())
+#define NM_DEVICE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_DEVICE, NMDevice))
+#define NM_DEVICE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  NM_TYPE_DEVICE, NMDeviceClass))
+#define NM_IS_DEVICE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_DEVICE))
+#define NM_IS_DEVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  NM_TYPE_DEVICE))
+#define NM_DEVICE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  NM_TYPE_DEVICE, NMDeviceClass))
 
 typedef enum NMActStageReturn NMActStageReturn;
 
@@ -201,7 +201,7 @@ typedef struct {
 
 	NMDeviceCapabilities (* get_generic_capabilities) (NMDevice *self);
 
-	gboolean	(* is_available) (NMDevice *self, NMDeviceCheckDevAvailableFlags flags);
+	gboolean    (* is_available) (NMDevice *self, NMDeviceCheckDevAvailableFlags flags);
 
 	gboolean    (* get_enabled) (NMDevice *self);
 
@@ -239,19 +239,19 @@ typedef struct {
 	                                             const GSList *existing_connections,
 	                                             GError **error);
 
-	NMActStageReturn	(* act_stage1_prepare)	(NMDevice *self,
+	NMActStageReturn    (* act_stage1_prepare)  (NMDevice *self,
 	                                             NMDeviceStateReason *reason);
-	NMActStageReturn	(* act_stage2_config)	(NMDevice *self,
+	NMActStageReturn    (* act_stage2_config)   (NMDevice *self,
 	                                             NMDeviceStateReason *reason);
-	NMActStageReturn	(* act_stage3_ip4_config_start) (NMDevice *self,
+	NMActStageReturn    (* act_stage3_ip4_config_start) (NMDevice *self,
 	                                                     NMIP4Config **out_config,
 	                                                     NMDeviceStateReason *reason);
-	NMActStageReturn	(* act_stage3_ip6_config_start) (NMDevice *self,
+	NMActStageReturn    (* act_stage3_ip6_config_start) (NMDevice *self,
 	                                                     NMIP6Config **out_config,
 	                                                     NMDeviceStateReason *reason);
-	NMActStageReturn	(* act_stage4_ip4_config_timeout)	(NMDevice *self,
+	NMActStageReturn    (* act_stage4_ip4_config_timeout)   (NMDevice *self,
 	                                                         NMDeviceStateReason *reason);
-	NMActStageReturn	(* act_stage4_ip6_config_timeout)	(NMDevice *self,
+	NMActStageReturn    (* act_stage4_ip6_config_timeout)   (NMDevice *self,
 	                                                         NMDeviceStateReason *reason);
 
 	/* Called right before IP config is set; use for setting MTU etc */
@@ -268,7 +268,7 @@ typedef struct {
 	                                             GError **error);
 
 	/* Sync deactivating (in the DISCONNECTED phase) */
-	void			(* deactivate)			(NMDevice *self);
+	void            (* deactivate) (NMDevice *self);
 
 	const char *(*get_type_description) (NMDevice *self);
 
@@ -326,38 +326,38 @@ typedef void (*NMDeviceAuthRequestFunc) (NMDevice *device,
 
 GType nm_device_get_type (void);
 
-const char *	nm_device_get_udi		(NMDevice *dev);
-const char *	nm_device_get_iface		(NMDevice *dev);
-int             nm_device_get_ifindex	(NMDevice *dev);
-gboolean        nm_device_is_software   (NMDevice *dev);
-gboolean        nm_device_is_real       (NMDevice *dev);
-const char *	nm_device_get_ip_iface	(NMDevice *dev);
-int             nm_device_get_ip_ifindex(NMDevice *dev);
-const char *	nm_device_get_driver	(NMDevice *dev);
-const char *	nm_device_get_driver_version	(NMDevice *dev);
-const char *	nm_device_get_type_desc (NMDevice *dev);
-const char *	nm_device_get_type_description (NMDevice *dev);
-NMDeviceType	nm_device_get_device_type	(NMDevice *dev);
-NMLinkType	nm_device_get_link_type	(NMDevice *dev);
-NMMetered       nm_device_get_metered	(NMDevice *dev);
-
-int			nm_device_get_priority (NMDevice *dev);
-guint32     nm_device_get_ip4_route_metric (NMDevice *dev);
-guint32     nm_device_get_ip6_route_metric (NMDevice *dev);
-
-const char *    nm_device_get_hw_address           (NMDevice *dev);
+const char *    nm_device_get_udi               (NMDevice *dev);
+const char *    nm_device_get_iface             (NMDevice *dev);
+int             nm_device_get_ifindex           (NMDevice *dev);
+gboolean        nm_device_is_software           (NMDevice *dev);
+gboolean        nm_device_is_real               (NMDevice *dev);
+const char *    nm_device_get_ip_iface          (NMDevice *dev);
+int             nm_device_get_ip_ifindex        (NMDevice *dev);
+const char *    nm_device_get_driver            (NMDevice *dev);
+const char *    nm_device_get_driver_version    (NMDevice *dev);
+const char *    nm_device_get_type_desc         (NMDevice *dev);
+const char *    nm_device_get_type_description  (NMDevice *dev);
+NMDeviceType    nm_device_get_device_type       (NMDevice *dev);
+NMLinkType      nm_device_get_link_type         (NMDevice *dev);
+NMMetered       nm_device_get_metered           (NMDevice *dev);
+
+int             nm_device_get_priority          (NMDevice *dev);
+guint32         nm_device_get_ip4_route_metric  (NMDevice *dev);
+guint32         nm_device_get_ip6_route_metric  (NMDevice *dev);
+
+const char *    nm_device_get_hw_address        (NMDevice *dev);
 const char *    nm_device_get_permanent_hw_address (NMDevice *dev);
-const char *    nm_device_get_initial_hw_address   (NMDevice *dev);
+const char *    nm_device_get_initial_hw_address (NMDevice *dev);
 
-NMDhcp4Config * nm_device_get_dhcp4_config (NMDevice *dev);
-NMDhcp6Config * nm_device_get_dhcp6_config (NMDevice *dev);
+NMDhcp4Config * nm_device_get_dhcp4_config      (NMDevice *dev);
+NMDhcp6Config * nm_device_get_dhcp6_config      (NMDevice *dev);
 
-NMIP4Config *	nm_device_get_ip4_config	(NMDevice *dev);
+NMIP4Config *   nm_device_get_ip4_config        (NMDevice *dev);
 void            nm_device_replace_vpn4_config   (NMDevice *dev,
                                                  NMIP4Config *old,
                                                  NMIP4Config *config);
 
-NMIP6Config *	nm_device_get_ip6_config	(NMDevice *dev);
+NMIP6Config *   nm_device_get_ip6_config        (NMDevice *dev);
 void            nm_device_replace_vpn6_config   (NMDevice *dev,
                                                  NMIP6Config *old,
                                                  NMIP6Config *config);
@@ -365,22 +365,22 @@ void            nm_device_replace_vpn6_config   (NMDevice *dev,
 void            nm_device_capture_initial_config (NMDevice *dev);
 
 /* Master */
-gboolean        nm_device_is_master         (NMDevice *dev);
+gboolean        nm_device_is_master             (NMDevice *dev);
 
 /* Slave */
-NMDevice *      nm_device_get_master        (NMDevice *dev);
+NMDevice *      nm_device_get_master            (NMDevice *dev);
 
-NMActRequest *          nm_device_get_act_request               (NMDevice *dev);
-NMSettingsConnection *  nm_device_get_settings_connection       (NMDevice *dev);
-NMConnection *          nm_device_get_applied_connection        (NMDevice *dev);
-gboolean                nm_device_has_unmodified_applied_connection (NMDevice *self,
-                                                                     NMSettingCompareFlags compare_flags);
-NMSetting *             nm_device_get_applied_setting           (NMDevice *dev, GType setting_type);
+NMActRequest *  nm_device_get_act_request       (NMDevice *dev);
+NMSettingsConnection *nm_device_get_settings_connection (NMDevice *dev);
+NMConnection *  nm_device_get_applied_connection (NMDevice *dev);
+gboolean        nm_device_has_unmodified_applied_connection (NMDevice *self,
+                                                             NMSettingCompareFlags compare_flags);
+NMSetting *     nm_device_get_applied_setting   (NMDevice *dev, GType setting_type);
 
-void            nm_device_removed        (NMDevice *dev);
+void            nm_device_removed               (NMDevice *dev);
 
-gboolean        nm_device_is_available   (NMDevice *dev, NMDeviceCheckDevAvailableFlags flags);
-gboolean        nm_device_has_carrier    (NMDevice *dev);
+gboolean        nm_device_is_available          (NMDevice *dev, NMDeviceCheckDevAvailableFlags flags);
+gboolean        nm_device_has_carrier           (NMDevice *dev);
 
 NMConnection * nm_device_generate_connection (NMDevice *self, NMDevice *master);
 
@@ -408,8 +408,8 @@ gboolean nm_device_can_assume_active_connection (NMDevice *device);
 
 gboolean nm_device_spec_match_list (NMDevice *device, const GSList *specs);
 
-gboolean		nm_device_is_activating		(NMDevice *dev);
-gboolean		nm_device_autoconnect_allowed	(NMDevice *self);
+gboolean nm_device_is_activating (NMDevice *dev);
+gboolean nm_device_autoconnect_allowed (NMDevice *self);
 
 NMDeviceState nm_device_get_state (NMDevice *device);
 
@@ -472,6 +472,7 @@ typedef enum {
 const char *nm_unmanaged_flags2str (NMUnmanagedFlags flags, char *buf, gsize len);
 
 gboolean nm_device_get_managed (NMDevice *device, gboolean for_user_request);
+NMUnmanagedFlags nm_device_get_unmanaged_mask (NMDevice *device, NMUnmanagedFlags flag);
 NMUnmanagedFlags nm_device_get_unmanaged_flags (NMDevice *device, NMUnmanagedFlags flag);
 void nm_device_set_unmanaged_flags (NMDevice *device,
                                     NMUnmanagedFlags flags,
@@ -563,7 +564,8 @@ void nm_device_reactivate_ip6_config (NMDevice *device,
 
 void nm_device_update_hw_address (NMDevice *self);
 void nm_device_update_initial_hw_address (NMDevice *self);
+void nm_device_update_dynamic_ip_setup (NMDevice *self);
 
 G_END_DECLS
 
-#endif	/* NM_DEVICE_H */
+#endif /* NM_DEVICE_H */
diff --git a/src/devices/nm-lldp-listener.c b/src/devices/nm-lldp-listener.c
index e678dc67..592059f5 100644
--- a/src/devices/nm-lldp-listener.c
+++ b/src/devices/nm-lldp-listener.c
@@ -30,9 +30,6 @@
 
 #include "sd-lldp.h"
 
-#include "nm-sd-adapt.h"
-#include "lldp.h"
-
 #define MAX_NEIGHBORS         4096
 #define MIN_UPDATE_INTERVAL_NS (2 * NM_UTILS_NS_PER_SECOND)
 
@@ -402,13 +399,13 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
 	}
 
 	switch (chassis_id_type) {
-	case LLDP_CHASSIS_SUBTYPE_INTERFACE_ALIAS:
-	case LLDP_CHASSIS_SUBTYPE_INTERFACE_NAME:
-	case LLDP_CHASSIS_SUBTYPE_LOCALLY_ASSIGNED:
-	case LLDP_CHASSIS_SUBTYPE_CHASSIS_COMPONENT:
+	case SD_LLDP_CHASSIS_SUBTYPE_INTERFACE_ALIAS:
+	case SD_LLDP_CHASSIS_SUBTYPE_INTERFACE_NAME:
+	case SD_LLDP_CHASSIS_SUBTYPE_LOCALLY_ASSIGNED:
+	case SD_LLDP_CHASSIS_SUBTYPE_CHASSIS_COMPONENT:
 		neigh->chassis_id = g_strndup ((const char *) chassis_id, chassis_id_len);
 		break;
-	case LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS:
+	case SD_LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS:
 		neigh->chassis_id = nm_utils_hwaddr_ntoa (chassis_id, chassis_id_len);
 		break;
 	default:
@@ -418,13 +415,13 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
 	}
 
 	switch (port_id_type) {
-	case LLDP_PORT_SUBTYPE_INTERFACE_ALIAS:
-	case LLDP_PORT_SUBTYPE_INTERFACE_NAME:
-	case LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED:
-	case LLDP_PORT_SUBTYPE_PORT_COMPONENT:
+	case SD_LLDP_PORT_SUBTYPE_INTERFACE_ALIAS:
+	case SD_LLDP_PORT_SUBTYPE_INTERFACE_NAME:
+	case SD_LLDP_PORT_SUBTYPE_LOCALLY_ASSIGNED:
+	case SD_LLDP_PORT_SUBTYPE_PORT_COMPONENT:
 		neigh->port_id = strndup ((char *) port_id, port_id_len);
 		break;
-	case LLDP_PORT_SUBTYPE_MAC_ADDRESS:
+	case SD_LLDP_PORT_SUBTYPE_MAC_ADDRESS:
 		neigh->port_id = nm_utils_hwaddr_ntoa (port_id, port_id_len);
 		break;
 	default:
@@ -464,11 +461,11 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
 			goto out;
 		}
 
-		if (!(   memcmp (oui, LLDP_OUI_802_1, sizeof (oui)) == 0
+		if (!(   memcmp (oui, SD_LLDP_OUI_802_1, sizeof (oui)) == 0
 		      && NM_IN_SET (subtype,
-		                    LLDP_OUI_802_1_SUBTYPE_PORT_PROTOCOL_VLAN_ID,
-		                    LLDP_OUI_802_1_SUBTYPE_PORT_VLAN_ID,
-		                    LLDP_OUI_802_1_SUBTYPE_VLAN_NAME)))
+		                    SD_LLDP_OUI_802_1_SUBTYPE_PORT_PROTOCOL_VLAN_ID,
+		                    SD_LLDP_OUI_802_1_SUBTYPE_PORT_VLAN_ID,
+		                    SD_LLDP_OUI_802_1_SUBTYPE_VLAN_NAME)))
 			continue;
 
 		if (sd_lldp_neighbor_tlv_get_raw (neighbor_sd, (void *) &data8, &len) < 0)
@@ -492,16 +489,16 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
 		data8 += 6;
 		len -= 6;
 
-		/*if (memcmp (oui, LLDP_OUI_802_1, sizeof (oui)) == 0)*/
+		/*if (memcmp (oui, SD_LLDP_OUI_802_1, sizeof (oui)) == 0)*/
 		{
 			switch (subtype) {
-			case LLDP_OUI_802_1_SUBTYPE_PORT_VLAN_ID:
+			case SD_LLDP_OUI_802_1_SUBTYPE_PORT_VLAN_ID:
 				if (len != 2)
 					continue;
 				_lldp_attr_set_uint32 (neigh->attrs, LLDP_ATTR_ID_IEEE_802_1_PVID,
 				                       _access_uint16 (data8));
 				break;
-			case LLDP_OUI_802_1_SUBTYPE_PORT_PROTOCOL_VLAN_ID:
+			case SD_LLDP_OUI_802_1_SUBTYPE_PORT_PROTOCOL_VLAN_ID:
 				if (len != 3)
 					continue;
 				_lldp_attr_set_uint32 (neigh->attrs, LLDP_ATTR_ID_IEEE_802_1_PPVID_FLAGS,
@@ -509,7 +506,7 @@ lldp_neighbor_new (sd_lldp_neighbor *neighbor_sd, GError **error)
 				_lldp_attr_set_uint32 (neigh->attrs, LLDP_ATTR_ID_IEEE_802_1_PPVID,
 				                       _access_uint16 (&data8[1]));
 				break;
-			case LLDP_OUI_802_1_SUBTYPE_VLAN_NAME: {
+			case SD_LLDP_OUI_802_1_SUBTYPE_VLAN_NAME: {
 				int l;
 
 				if (len <= 3)
diff --git a/src/devices/team/Makefile.am b/src/devices/team/Makefile.am
index a6645833..3609ace4 100644
--- a/src/devices/team/Makefile.am
+++ b/src/devices/team/Makefile.am
@@ -14,7 +14,6 @@ AM_CPPFLAGS = \
 	-I${top_srcdir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-team"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS)
 
 if WITH_TEAMDCTL
diff --git a/src/devices/team/Makefile.in b/src/devices/team/Makefile.in
index 6dce463e..115a7589 100644
--- a/src/devices/team/Makefile.in
+++ b/src/devices/team/Makefile.in
@@ -492,8 +492,7 @@ AM_CPPFLAGS = -I${top_srcdir}/src -I${top_builddir}/src \
 	-I${top_srcdir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-team"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE $(GLIB_CFLAGS) \
-	$(am__append_1)
+	$(GLIB_CFLAGS) $(am__append_1)
 pkglib_LTLIBRARIES = libnm-device-plugin-team.la
 SYMBOL_VIS_FILE = $(srcdir)/exports.ver
 libnm_device_plugin_team_la_SOURCES = \
diff --git a/src/devices/tests/Makefile.am b/src/devices/tests/Makefile.am
index e4f4d3fe..cd1ef6ed 100644
--- a/src/devices/tests/Makefile.am
+++ b/src/devices/tests/Makefile.am
@@ -12,7 +12,6 @@ AM_CPPFLAGS = \
 	-I$(top_builddir)/src \
 	-DG_LOG_DOMAIN=\""NetworkManager"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS)
 
 AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
diff --git a/src/devices/tests/Makefile.in b/src/devices/tests/Makefile.in
index 1cb73d28..31cf0d38 100644
--- a/src/devices/tests/Makefile.in
+++ b/src/devices/tests/Makefile.in
@@ -671,7 +671,6 @@ AM_CPPFLAGS = \
 	-I$(top_builddir)/src \
 	-DG_LOG_DOMAIN=\""NetworkManager"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS)
 
 AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
diff --git a/src/devices/tests/test-lldp.c b/src/devices/tests/test-lldp.c
index 85c3b510..1b7f536d 100644
--- a/src/devices/tests/test-lldp.c
+++ b/src/devices/tests/test-lldp.c
@@ -29,8 +29,7 @@
 #include "nm-lldp-listener.h"
 #include "nm-sd.h"
 
-#include "nm-sd-adapt.h"
-#include "lldp.h"
+#include "sd-lldp.h"
 
 #include "test-common.h"
 
@@ -147,8 +146,8 @@ _test_recv_data0_check (GMainLoop *loop, NMLldpListener *listener)
 	g_assert_cmpint (g_variant_n_children (neighbors), ==, 1);
 
 	neighbor = get_lldp_neighbor (neighbors,
-	                              LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS, "00:01:02:03:04:05",
-	                              LLDP_PORT_SUBTYPE_INTERFACE_NAME, "1/3");
+	                              SD_LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS, "00:01:02:03:04:05",
+	                              SD_LLDP_PORT_SUBTYPE_INTERFACE_NAME, "1/3");
 	g_assert (neighbor);
 	g_assert_cmpint (g_variant_n_children (neighbor), ==, 4 + 4);
 
@@ -244,8 +243,8 @@ _test_recv_data1_check (GMainLoop *loop, NMLldpListener *listener)
 	g_assert_cmpint (g_variant_n_children (neighbors), ==, 1);
 
 	neighbor = get_lldp_neighbor (neighbors,
-	                              LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS, "00:01:30:F9:AD:A0",
-	                              LLDP_PORT_SUBTYPE_INTERFACE_NAME, "1/1");
+	                              SD_LLDP_CHASSIS_SUBTYPE_MAC_ADDRESS, "00:01:30:F9:AD:A0",
+	                              SD_LLDP_PORT_SUBTYPE_INTERFACE_NAME, "1/1");
 	g_assert (neighbor);
 	g_assert_cmpint (g_variant_n_children (neighbor), ==, 4 + 10);
 
diff --git a/src/devices/wifi/Makefile.am b/src/devices/wifi/Makefile.am
index b0919ef7..e35a84b4 100644
--- a/src/devices/wifi/Makefile.am
+++ b/src/devices/wifi/Makefile.am
@@ -20,7 +20,6 @@ AM_CPPFLAGS = \
 	-I${top_srcdir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS)
 
 pkglib_LTLIBRARIES = libnm-device-plugin-wifi.la
diff --git a/src/devices/wifi/Makefile.in b/src/devices/wifi/Makefile.in
index 1286a480..a180a434 100644
--- a/src/devices/wifi/Makefile.in
+++ b/src/devices/wifi/Makefile.in
@@ -539,7 +539,6 @@ AM_CPPFLAGS = \
 	-I${top_srcdir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS)
 
 pkglib_LTLIBRARIES = libnm-device-plugin-wifi.la
diff --git a/src/devices/wifi/tests/Makefile.am b/src/devices/wifi/tests/Makefile.am
index dee8e799..d05ccf7e 100644
--- a/src/devices/wifi/tests/Makefile.am
+++ b/src/devices/wifi/tests/Makefile.am
@@ -10,7 +10,6 @@ AM_CPPFLAGS = \
 	-I$(top_builddir)/src \
 	-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS)
 
 noinst_PROGRAMS = test-wifi-ap-utils
diff --git a/src/devices/wifi/tests/Makefile.in b/src/devices/wifi/tests/Makefile.in
index 90900f00..be874cc3 100644
--- a/src/devices/wifi/tests/Makefile.in
+++ b/src/devices/wifi/tests/Makefile.in
@@ -664,7 +664,6 @@ AM_CPPFLAGS = \
 	-I$(top_builddir)/src \
 	-DG_LOG_DOMAIN=\""NetworkManager-wifi"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS)
 
 test_wifi_ap_utils_SOURCES = \
diff --git a/src/devices/wwan/Makefile.am b/src/devices/wwan/Makefile.am
index 107f630b..1777eb36 100644
--- a/src/devices/wwan/Makefile.am
+++ b/src/devices/wwan/Makefile.am
@@ -15,7 +15,6 @@ AM_CPPFLAGS = \
 	-I${top_builddir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-wwan"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS) \
 	$(MM_GLIB_CFLAGS)
 
diff --git a/src/devices/wwan/Makefile.in b/src/devices/wwan/Makefile.in
index ac13135e..e7722414 100644
--- a/src/devices/wwan/Makefile.in
+++ b/src/devices/wwan/Makefile.in
@@ -506,7 +506,6 @@ AM_CPPFLAGS = \
 	-I${top_builddir}/libnm-core \
 	-DG_LOG_DOMAIN=\""NetworkManager-wwan"\" \
 	-DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \
-	-DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \
 	$(GLIB_CFLAGS) \
 	$(MM_GLIB_CFLAGS)