about summary refs log tree commit diff
path: root/src/devices/nm-device-tun.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2019-01-25 11:26:25 +0100
committerSebastien Bacher <seb128@ubuntu.com>2019-01-25 11:26:25 +0100
commitf54a568880bf47c2ea54c9b30d291156b34d6539 (patch)
treeaab9bb44b306da7651e8caf38bbab5cfeeb81b7d /src/devices/nm-device-tun.c
parente8ac7dacdcf4b38addef4f8ac6ab038f9d29582c (diff)
parentbbae86d3d2997a853ca0365e8eb7a3ca7489ee09 (diff)
Update upstream source from tag 'upstream/1.15.2'
Update to upstream version '1.15.2'
with Debian dir b4be4b7cfce96679a31cb9d423107789761e3b49
Diffstat (limited to 'src/devices/nm-device-tun.c')
-rw-r--r--src/devices/nm-device-tun.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/devices/nm-device-tun.c b/src/devices/nm-device-tun.c
index 0f76b23a..3fe3dfd4 100644
--- a/src/devices/nm-device-tun.c
+++ b/src/devices/nm-device-tun.c
@@ -231,9 +231,10 @@ create_and_realize (NMDevice *device,
 {
 	const char *iface = nm_device_get_iface (device);
 	NMPlatformLnkTun props = { };
-	NMPlatformError plerr;
 	NMSettingTun *s_tun;
-	gint64 owner, group;
+	gint64 owner;
+	gint64 group;
+	int r;
 
 	s_tun = nm_connection_get_setting_tun (connection);
 	g_return_val_if_fail (s_tun, FALSE);
@@ -261,17 +262,17 @@ create_and_realize (NMDevice *device,
 	props.multi_queue = nm_setting_tun_get_multi_queue (s_tun);
 	props.persist = TRUE;
 
-	plerr = nm_platform_link_tun_add (nm_device_get_platform (device),
-	                                  iface,
-	                                  &props,
-	                                  out_plink,
-	                                  NULL);
-	if (plerr != NM_PLATFORM_ERROR_SUCCESS) {
+	r = nm_platform_link_tun_add (nm_device_get_platform (device),
+	                              iface,
+	                              &props,
+	                              out_plink,
+	                              NULL);
+	if (r < 0) {
 		g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_CREATION_FAILED,
 		             "Failed to create TUN/TAP interface '%s' for '%s': %s",
 		             iface,
 		             nm_connection_get_id (connection),
-		             nm_platform_error_to_string_a (plerr));
+		             nm_strerror (r));
 		return FALSE;
 	}