summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2018-10-24 21:01:12 +0200
committerMichael Biebl <biebl@debian.org>2018-10-24 21:01:12 +0200
commit3626b425d1bc017fdc6f1ea0cfd329d1e1681641 (patch)
treee3eb1ffa953bc2ca100c9c50ab2aaa8cbfffa8f0 /src
parent6518e361171f64bcaaa4bf868139362ed95cc2e0 (diff)
New upstream version 1.14.4 upstream/1.14.4
Diffstat (limited to 'src')
-rw-r--r--src/devices/bluetooth/meson.build3
-rw-r--r--src/devices/nm-device.c2
-rw-r--r--src/devices/wwan/meson.build3
-rw-r--r--src/dhcp/nm-dhcp-dhclient.c1
-rw-r--r--src/initrd/nmi-cmdline-reader.c14
-rw-r--r--src/meson.build13
-rw-r--r--src/ndisc/nm-lndp-ndisc.c2
-rw-r--r--src/ndisc/tests/meson.build6
-rw-r--r--src/platform/tests/meson.build26
-rw-r--r--src/platform/tests/test-nmp-object.c8
-rw-r--r--src/settings/plugins/ifcfg-rh/tests/meson.build1
-rw-r--r--src/settings/plugins/ifupdown/nms-ifupdown-plugin.c2
12 files changed, 49 insertions, 32 deletions
diff --git a/src/devices/bluetooth/meson.build b/src/devices/bluetooth/meson.build
index 019f04f6..628a3bc8 100644
--- a/src/devices/bluetooth/meson.build
+++ b/src/devices/bluetooth/meson.build
@@ -26,7 +26,8 @@ libnm_device_plugin_bluetooth = shared_module(
   link_args: ldflags_linker_script_devices,
   link_depends: linker_script_devices,
   install: true,
-  install_dir: nm_plugindir
+  install_dir: nm_plugindir,
+  install_rpath: nm_plugindir
 )
 
 core_plugins += libnm_device_plugin_bluetooth
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 26ea06bd..f2dbe659 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -5486,7 +5486,7 @@ nm_device_generate_connection (NMDevice *self,
 
 	klass->update_connection (self, connection);
 
-	if (!nm_connection_normalize (connection, NULL, NULL, error)) {
+	if (!nm_connection_normalize (connection, NULL, NULL, &local)) {
 		g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED,
 		             "generated connection does not verify: %s",
 		             local->message);
diff --git a/src/devices/wwan/meson.build b/src/devices/wwan/meson.build
index 2c0ea5a1..5fe6e433 100644
--- a/src/devices/wwan/meson.build
+++ b/src/devices/wwan/meson.build
@@ -54,7 +54,8 @@ libnm_device_plugin_wwan = shared_module(
   link_args: ldflags_linker_script_devices,
   link_depends: linker_script_devices,
   install: true,
-  install_dir: nm_plugindir
+  install_dir: nm_plugindir,
+  install_rpath: nm_plugindir
 )
 
 core_plugins += libnm_device_plugin_wwan
diff --git a/src/dhcp/nm-dhcp-dhclient.c b/src/dhcp/nm-dhcp-dhclient.c
index 4a936178..33c26712 100644
--- a/src/dhcp/nm-dhcp-dhclient.c
+++ b/src/dhcp/nm-dhcp-dhclient.c
@@ -142,6 +142,7 @@ get_dhclient_leasefile (int addr_family,
 	                        iface);
 
 	if (g_file_test (path, G_FILE_TEST_EXISTS)) {
+		g_free (rundir_path);
 		NM_SET_OUT (out_preferred_path, g_strdup (path));
 		return path;
 	}
diff --git a/src/initrd/nmi-cmdline-reader.c b/src/initrd/nmi-cmdline-reader.c
index 2cef534e..e3b1bb63 100644
--- a/src/initrd/nmi-cmdline-reader.c
+++ b/src/initrd/nmi-cmdline-reader.c
@@ -138,9 +138,17 @@ _base_setting_set (NMConnection *connection, const char *property, const char *v
 
 	setting = nm_connection_get_setting_by_name (connection, type_name);
 
-	if (G_IS_PARAM_SPEC_UINT (spec))
-		g_object_set (setting, property, g_ascii_strtoull (value, NULL, 10), NULL);
-	else if (G_IS_PARAM_SPEC_STRING (spec))
+	if (G_IS_PARAM_SPEC_UINT (spec)) {
+		guint v;
+
+		v =  _nm_utils_ascii_str_to_int64 (value, 10, 0, G_MAXUINT, 0);
+		if (   errno
+		    || !nm_g_object_set_property_uint (G_OBJECT (setting), property, v, NULL)) {
+			_LOGW (LOGD_CORE,
+			       "Could not set property '%s.%s' to '%s'",
+			       type_name, property, value);
+		}
+	} else if (G_IS_PARAM_SPEC_STRING (spec))
 		g_object_set (setting, property, value, NULL);
 	else
 		_LOGW (LOGD_CORE, "Don't know how to set '%s' of %s\n", property, type_name);
diff --git a/src/meson.build b/src/meson.build
index 87c57671..28fcfa8f 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -214,9 +214,6 @@ if enable_tests
     test_cflags += ['-DREQUIRE_ROOT_TESTS=1']
   endif
 
-  platform = (host_machine.system().contains('linux') ? 'linux' : 'fake')
-  test_cflags_platform = '-DSETUP=nm_' + platform + '_platform_setup'
-
   libnetwork_manager_test = static_library(
     nm_name + 'Test',
     sources: sources,
@@ -231,6 +228,16 @@ if enable_tests
     link_with: libnetwork_manager_test
   )
 
+  test_nm_dep_fake = declare_dependency(
+    dependencies: test_nm_dep,
+    compile_args: ['-DSETUP=nm_fake_platform_setup']
+  )
+
+  test_nm_dep_linux = declare_dependency(
+    dependencies: test_nm_dep,
+    compile_args: ['-DSETUP=nm_linux_platform_setup']
+  )
+
   subdir('dnsmasq/tests')
   subdir('ndisc/tests')
   subdir('platform/tests')
diff --git a/src/ndisc/nm-lndp-ndisc.c b/src/ndisc/nm-lndp-ndisc.c
index 9f427d4d..e1003ad1 100644
--- a/src/ndisc/nm-lndp-ndisc.c
+++ b/src/ndisc/nm-lndp-ndisc.c
@@ -491,7 +491,7 @@ receive_rs (struct ndp *ndp, struct ndp_msg *msg, gpointer user_data)
 static gboolean
 event_ready (GIOChannel *source, GIOCondition condition, NMNDisc *ndisc)
 {
-	gs_unref_object NMNDisc *ndisc_keep_alive = g_object_ref (ndisc);
+	_nm_unused gs_unref_object NMNDisc *ndisc_keep_alive = g_object_ref (ndisc);
 	nm_auto_pop_netns NMPNetns *netns = NULL;
 	NMLndpNDiscPrivate *priv = NM_LNDP_NDISC_GET_PRIVATE ((NMLndpNDisc *) ndisc);
 
diff --git a/src/ndisc/tests/meson.build b/src/ndisc/tests/meson.build
index 2f479c2d..e0dc9aa6 100644
--- a/src/ndisc/tests/meson.build
+++ b/src/ndisc/tests/meson.build
@@ -3,8 +3,7 @@ test_unit = 'test-ndisc-fake'
 exe = executable(
   test_unit,
   test_unit + '.c',
-  dependencies: test_nm_dep,
-  c_args: test_cflags_platform
+  dependencies: test_nm_dep_fake,
 )
 
 test(
@@ -18,6 +17,5 @@ test = 'test-ndisc-linux'
 exe = executable(
   test,
   test + '.c',
-  dependencies: test_nm_dep,
-  c_args: test_cflags_platform
+  dependencies: test_nm_dep_linux,
 )
diff --git a/src/platform/tests/meson.build b/src/platform/tests/meson.build
index 0571efac..bedc6916 100644
--- a/src/platform/tests/meson.build
+++ b/src/platform/tests/meson.build
@@ -1,28 +1,27 @@
 test_units = [
-  ['test-link-fake', 'test-link.c', 60],
-  ['test-link-linux', 'test-link.c', 60],
-  ['test-address-fake', 'test-address.c'],
-  ['test-address-linux', 'test-address.c'],
-  ['test-general', 'test-general.c'],
-  ['test-nmp-object', 'test-nmp-object.c'],
-  ['test-route-fake', 'test-route.c'],
-  ['test-route-linux', 'test-route.c'],
-  ['test-cleanup-fake', 'test-cleanup.c'],
-  ['test-cleanup-linux', 'test-cleanup.c'],
+  ['test-link-fake',     'test-link.c',       test_nm_dep_fake,  30],
+  ['test-link-linux',    'test-link.c',       test_nm_dep_linux, 180],
+  ['test-address-fake',  'test-address.c',    test_nm_dep_fake,  30],
+  ['test-address-linux', 'test-address.c',    test_nm_dep_linux, 30],
+  ['test-general',       'test-general.c',    test_nm_dep,       30],
+  ['test-nmp-object',    'test-nmp-object.c', test_nm_dep,       30],
+  ['test-route-fake',    'test-route.c',      test_nm_dep_fake,  30],
+  ['test-route-linux',   'test-route.c',      test_nm_dep_linux, 30],
+  ['test-cleanup-fake',  'test-cleanup.c',    test_nm_dep_fake,  30],
+  ['test-cleanup-linux', 'test-cleanup.c',    test_nm_dep_linux, 30],
 ]
 
 foreach test_unit: test_units
   exe = executable(
     'platform-' + test_unit[0],
     test_unit[1],
-    dependencies: test_nm_dep,
-    c_args: test_cflags_platform
+    dependencies: test_unit[2],
   )
 
   test(
     'platform/' + test_unit[0],
     test_script,
-    timeout: test_unit.length() > 2 ? test_unit[2] : 30,
+    timeout: test_unit[3],
     args: test_args + [exe.full_path()]
   )
 endforeach
@@ -33,5 +32,4 @@ executable(
   test,
   test + '.c',
   dependencies: test_nm_dep,
-  c_args: test_cflags_platform
 )
diff --git a/src/platform/tests/test-nmp-object.c b/src/platform/tests/test-nmp-object.c
index 047d7a85..12acf4a5 100644
--- a/src/platform/tests/test-nmp-object.c
+++ b/src/platform/tests/test-nmp-object.c
@@ -267,10 +267,11 @@ test_cache_link (void)
 	struct udev_device *udev_device_3 = g_list_nth_data (global.udev_devices, 0);
 	NMPCacheOpsType ops_type;
 	nm_auto_unref_dedup_multi_index NMDedupMultiIndex *multi_idx = NULL;
+	gboolean use_udev = nmtst_get_rand_int () % 2;
 
 	multi_idx = nm_dedup_multi_index_new ();
 
-	cache = nmp_cache_new (multi_idx, nmtst_get_rand_int () % 2);
+	cache = nmp_cache_new (multi_idx, use_udev);
 
 	/* if we have a link, and don't set is_in_netlink, adding it has no effect. */
 	objm1 = nmp_object_new (NMP_OBJECT_TYPE_LINK, (NMPlatformObject *) &pl_link_2);
@@ -387,7 +388,8 @@ test_cache_link (void)
 	} else {
 		g_assert (nmp_cache_lookup_obj (cache, objm1) == NULL);
 		g_assert (nmp_cache_lookup_obj (cache, nmp_object_stackinit_id_link (&objs1, pl_link_2.ifindex)) == NULL);
-		g_assert (nmp_object_is_visible (obj_new));
+		g_assert (!nmp_object_is_alive (obj_new));
+		g_assert (!nmp_object_is_visible (obj_new));
 	}
 	nmp_object_unref (objm1);
 	nmp_object_unref (obj_old);
@@ -587,7 +589,7 @@ main (int argc, char **argv)
 
 	while (global.udev_devices) {
 		udev_device_unref (global.udev_devices->data);
-		global.udev_devices = g_list_remove (global.udev_devices, global.udev_devices->data);
+		global.udev_devices = g_list_delete_link (global.udev_devices, global.udev_devices);
 	}
 
 	nm_udev_client_unref (udev_client);
diff --git a/src/settings/plugins/ifcfg-rh/tests/meson.build b/src/settings/plugins/ifcfg-rh/tests/meson.build
index 0593f12d..29bc9699 100644
--- a/src/settings/plugins/ifcfg-rh/tests/meson.build
+++ b/src/settings/plugins/ifcfg-rh/tests/meson.build
@@ -12,5 +12,6 @@ exe = executable(
 test(
   'ifcfg-rh/' + test_unit,
   test_script,
+  timeout: 90,
   args: test_args + [exe.full_path()]
 )
diff --git a/src/settings/plugins/ifupdown/nms-ifupdown-plugin.c b/src/settings/plugins/ifupdown/nms-ifupdown-plugin.c
index 88c651b8..b66eedc7 100644
--- a/src/settings/plugins/ifupdown/nms-ifupdown-plugin.c
+++ b/src/settings/plugins/ifupdown/nms-ifupdown-plugin.c
@@ -171,7 +171,7 @@ initialize (NMSettingsPlugin *plugin)
 
 		if (nm_streq (block->type, "iface")) {
 			/* Bridge configuration */
-			if (g_str_has_prefix (block_name, "br")) {
+			if (g_str_has_prefix (block->name, "br")) {
 				/* Try to find bridge ports */
 				const char *ports = ifparser_getkey (block, "bridge-ports");