]> git.pld-linux.org Git - packages/NetworkManager.git/blame - accept_non_null_device.patch
upstream patch to fix regression when connecting to vpn from nm-applet
[packages/NetworkManager.git] / accept_non_null_device.patch
CommitLineData
460a3d55
JP
1From 9748aef7c7982ad1fe377ab6fc64255fcdb52762 Mon Sep 17 00:00:00 2001
2From: Beniamino Galvani <bgalvani@redhat.com>
3Date: Fri, 6 Jul 2018 15:54:16 +0200
4Subject: [PATCH] manager: accept non-null device for VPN activations
5
6Commit 10753c36168a ("manager: merge VPN handling into
7_new_active_connection()") added a check to fail the activation of
8VPNs when a device is passed to ActivateConnection(), since the device
9argument is ignored for VPNs.
10
11This broke activating VPNs from nm-applet as nm-applet sets both the
12specific_object (parent-connection) and device arguments in the
13activation request.
14
15Note that we already check in _new_active_connection() that when a
16device is supplied, it matches the device of the parent
17connection. Therefore, the check can be dropped.
18
19Reported-by: Michael Biebl <biebl@debian.org>
20Fixes: 10753c36168a82cd658df8a7da800960fddd78ed
21
22https://github.com/NetworkManager/NetworkManager/pull/159
23(cherry picked from commit e205664ba8c25939f1678d1b078a67989c180046)
24---
25 src/nm-manager.c | 16 +---------------
26 1 file changed, 1 insertion(+), 15 deletions(-)
27
28diff --git a/src/nm-manager.c b/src/nm-manager.c
29index 0fea13de69..289dcf8382 100644
30--- a/src/nm-manager.c
31+++ b/src/nm-manager.c
32@@ -4611,21 +4611,7 @@ validate_activation_request (NMManager *self,
33 }
34 }
35
36- if (is_vpn && device) {
37- /* VPN's are treated specially. Maybe the should accept a device as well,
38- * however, later on during activation, we don't handle the device.
39- *
40- * Maybe we should, and maybe it makes sense to specify a device
41- * when activating a VPN. But for now, just error out. */
42- g_set_error_literal (error,
43- NM_MANAGER_ERROR,
44- NM_MANAGER_ERROR_UNKNOWN_DEVICE,
45- "Cannot specify device when activating VPN");
46- return NULL;
47- }
48-
49- nm_assert ( ( is_vpn && !device)
50- || (!is_vpn && NM_IS_DEVICE (device)));
51+ nm_assert (is_vpn || NM_IS_DEVICE (device));
52
53 *out_device = device;
54 *out_is_vpn = is_vpn;
This page took 0.038516 seconds and 4 git commands to generate.