GNOME Bugzilla – Bug 767846
nmcli down of a tun interface followed by nmcli up fails
Last modified: 2016-06-27 11:23:28 UTC
1. Create a connection of type tun mode tap 2. Down the connection 3. Up the connection Expected Results: Up operation succeeds After step 3, a usable tun network interface of mode tap exists in the system Actual Results: Up operation fails: reason="Failed to find a compatible device for this connection" No network interface exists Details: Step 1: joey@akita ~ $ nmcli c add ifname test-tap con-name test-tap type tun mode tap -- ipv4.method disabled ipv6.method ignore Connection 'test-tap' (258ebb7c-f68e-4356-8d47-5af5d7d63456) successfully added. joey@akita ~ $ ip link ls dev test-tap 377: test-tap: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000 link/ether 42:7d:6a:0e:8a:46 brd ff:ff:ff:ff:ff:ff Step 2: joey@akita ~ $ nmcli c down test-tap Connection 'test-tap' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/185) joey@akita ~ $ ip link ls dev test-tap Device "test-tap" does not exist. Step 3: joey@akita ~ $ nmcli c up test-tap Error: Connection activation failed: Failed to find a compatible device for this connection NetworkManager Logs: Step 1: juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0553] keyfile: add connection /etc/NetworkManager/system-connections/test-tap (258ebb7c-f68e-4356-8d47-5af5d7d63456,"test-tap") juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0562] manager: (test-tap): new Tun device (/org/freedesktop/NetworkManager/Devices/15) juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0573] audit: op="connection-add" uuid="258ebb7c-f68e-4356-8d47-5af5d7d63456" name="test-tap" pid=29735 uid=503 result="success" juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0621] device (test-tap): state change: unmanaged -> unavailable (reason 'managed') [10 20 2] juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0634] device (test-tap): state change: unavailable -> disconnected (reason 'none') [20 30 0] juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0638] policy: auto-activating connection 'test-tap' juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0645] device (test-tap): Activation: starting connection 'test-tap' (258ebb7c-f68e-4356-8d47-5af5d7d63456) juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0646] device (test-tap): state change: disconnected -> prepare (reason 'none') [30 40 0] juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0649] device (test-tap): state change: prepare -> config (reason 'none') [40 50 0] juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0652] device (test-tap): state change: config -> ip-config (reason 'none') [50 70 0] juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0655] device (test-tap): state change: ip-config -> secondaries (reason 'ip-config-unavailable') [70 90 5] juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0659] device (test-tap): state change: secondaries -> activated (reason 'none') [90 100 0] juin 19 18:58:40 akita NetworkManager[13900]: <info> [1466380720.0719] device (test-tap): Activation: successful, device activated. Step 2: juin 19 19:00:45 akita NetworkManager[13900]: <info> [1466380845.4994] device (test-tap): state change: activated -> deactivating (reason 'user-requested') [100 110 39] juin 19 19:00:45 akita NetworkManager[13900]: <info> [1466380845.5083] audit: op="connection-deactivate" uuid="258ebb7c-f68e-4356-8d47-5af5d7d63456" name="test-tap" pid=31199 uid=503 result="success" juin 19 19:00:45 akita NetworkManager[13900]: <info> [1466380845.5086] device (test-tap): state change: deactivating -> disconnected (reason 'user-requested') [110 30 39] juin 19 19:00:45 akita NetworkManager[13900]: <info> [1466380845.5221] device (test-tap): state change: disconnected -> unmanaged (reason 'user-requested') [30 10 39] Step 3: juin 19 19:01:20 akita NetworkManager[13900]: <info> [1466380880.9124] audit: op="connection-activate" uuid="258ebb7c-f68e-4356-8d47-5af5d7d63456" name="test-tap" result="fail" reason="Failed to find a compatible device for this connection"
NetworkManager version: commit 59269b6925e9947b4c11f1548ba1593dd4aa5371 Author: Thomas Haller <thaller@redhat.com> Date: Sat Jun 18 18:15:41 2016 +0200 clients: fix wrong assertion _assert_format_int() Fixes: 2822f92434e19ebd25b69672bc996fc8311ae929 Kernel Version: commit 2dcd0af568b0cf583645c8a317dd12e344b1c72a Author: Linus Torvalds <torvalds@linux-foundation.org> Date: Sun May 15 15:43:13 2016 -0700 Linux 4.6
Created attachment 330126 [details] [review] [PATCH] tun,vxlan: add the CAP_IS_SOFTWARE capability This patch fixes the issue for me.
At first I thought this should have happened already in the platform through realize_start_setup() and its check for nm_platform_link_is_software() but of course that requires the device to be created first. So yeah, the NMDevice subclass needs the flag even before it's realized or we can't create the device from a connection. LGTM.
lgtm
Applied to master: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=f2d5c8d7f84b92779a79fe59467f905db1af7ada and nm-1-2: https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?h=nm-1-2&id=696becf0d9e86b2ccd891393a253408f8468ae6e