|
|
7008eb |
From 7b6c55fb10c8f500a79075a66d6f5387199392be Mon Sep 17 00:00:00 2001
|
|
|
7008eb |
From: Beniamino Galvani <bgalvani@redhat.com>
|
|
|
7008eb |
Date: Fri, 6 Jul 2018 15:54:16 +0200
|
|
|
7008eb |
Subject: [PATCH] manager: accept non-null device for VPN activations
|
|
|
7008eb |
|
|
|
7008eb |
Commit 10753c36168a ("manager: merge VPN handling into
|
|
|
7008eb |
_new_active_connection()") added a check to fail the activation of
|
|
|
7008eb |
VPNs when a device is passed to ActivateConnection(), since the device
|
|
|
7008eb |
argument is ignored for VPNs.
|
|
|
7008eb |
|
|
|
7008eb |
This broke activating VPNs from nm-applet as nm-applet sets both the
|
|
|
7008eb |
specific_object (parent-connection) and device arguments in the
|
|
|
7008eb |
activation request.
|
|
|
7008eb |
|
|
|
7008eb |
Note that we already check in _new_active_connection() that when a
|
|
|
7008eb |
device is supplied, it matches the device of the parent
|
|
|
7008eb |
connection. Therefore, the check can be dropped.
|
|
|
7008eb |
|
|
|
7008eb |
Reported-by: Michael Biebl <biebl@debian.org>
|
|
|
7008eb |
Fixes: 10753c36168a82cd658df8a7da800960fddd78ed
|
|
|
7008eb |
|
|
|
7008eb |
https://github.com/NetworkManager/NetworkManager/pull/159
|
|
|
7008eb |
(cherry picked from commit e205664ba8c25939f1678d1b078a67989c180046)
|
|
|
7008eb |
(cherry picked from commit 9748aef7c7982ad1fe377ab6fc64255fcdb52762)
|
|
|
7008eb |
---
|
|
|
7008eb |
src/nm-manager.c | 16 +---------------
|
|
|
7008eb |
1 file changed, 1 insertion(+), 15 deletions(-)
|
|
|
7008eb |
|
|
|
7008eb |
diff --git a/src/nm-manager.c b/src/nm-manager.c
|
|
|
7008eb |
index 0fea13de6..289dcf838 100644
|
|
|
7008eb |
--- a/src/nm-manager.c
|
|
|
7008eb |
+++ b/src/nm-manager.c
|
|
|
7008eb |
@@ -4611,21 +4611,7 @@ validate_activation_request (NMManager *self,
|
|
|
7008eb |
}
|
|
|
7008eb |
}
|
|
|
7008eb |
|
|
|
7008eb |
- if (is_vpn && device) {
|
|
|
7008eb |
- /* VPN's are treated specially. Maybe the should accept a device as well,
|
|
|
7008eb |
- * however, later on during activation, we don't handle the device.
|
|
|
7008eb |
- *
|
|
|
7008eb |
- * Maybe we should, and maybe it makes sense to specify a device
|
|
|
7008eb |
- * when activating a VPN. But for now, just error out. */
|
|
|
7008eb |
- g_set_error_literal (error,
|
|
|
7008eb |
- NM_MANAGER_ERROR,
|
|
|
7008eb |
- NM_MANAGER_ERROR_UNKNOWN_DEVICE,
|
|
|
7008eb |
- "Cannot specify device when activating VPN");
|
|
|
7008eb |
- return NULL;
|
|
|
7008eb |
- }
|
|
|
7008eb |
-
|
|
|
7008eb |
- nm_assert ( ( is_vpn && !device)
|
|
|
7008eb |
- || (!is_vpn && NM_IS_DEVICE (device)));
|
|
|
7008eb |
+ nm_assert (is_vpn || NM_IS_DEVICE (device));
|
|
|
7008eb |
|
|
|
7008eb |
*out_device = device;
|
|
|
7008eb |
*out_is_vpn = is_vpn;
|
|
|
7008eb |
--
|
|
|
7008eb |
2.17.1
|
|
|
7008eb |
|