summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Groocock <me@frebib.net>2023-05-14 11:53:13 +0000
committerJoe Groocock <me@frebib.net>2023-05-14 11:57:07 +0000
commitb9c438a6758b0511bea108af952a6492ca845737 (patch)
treeeb12d6706b57d06fa19bc80ad02692133c9e34bc
parent834a786a308de0ce23e9dbee2a91711305b6e51a (diff)
downloadvyos-1x-b9c438a6758b0511bea108af952a6492ca845737.tar.gz
vyos-1x-b9c438a6758b0511bea108af952a6492ca845737.zip
Revert "veth: T3829: Allow moving veth into netns"
netns management for any Vyos interfaces doesn't work past the initial creation, because Vyos always tries to recreate it/move it into the netns even though it already exists. Until this is fixed, don't let anyone even attempt to use this: set interfaces virtual-ethernet veth10 peer-name 'veth100' set interfaces virtual-ethernet veth100 netns 'ns01' set interfaces virtual-ethernet veth100 peer-name 'veth10' set netns name ns01 commit vyos@r14# sudo ip netns exec ns01 ip link show 1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 12: veth100@if13: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000 link/ether ee:8f:0b:bd:a2:f8 brd ff:ff:ff:ff:ff:ff link-netnsid 0 [edit] vyos@r14# set interfaces virtual-ethernet veth100 description MyNetns commit Traceback (most recent call last): File "/usr/libexec/vyos/conf_mode/interfaces-virtual-ethernet.py", line 111, in <module> apply(c) File "/usr/libexec/vyos/conf_mode/interfaces-virtual-ethernet.py", line 101, in apply p.update(veth) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 1413, in update self.set_netns(config.get('netns', '')) File "/usr/lib/python3/dist-packages/vyos/ifconfig/interface.py", line 552, in set_netns self.set_interface('netns', netns) File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 183, in set_interface return self._set_command(self.config, name, value) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 110, in _set_command return self._command_set[name].get('format', lambda _: _)(self._cmd(cmd)) ^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/ifconfig/control.py", line 52, in _cmd return cmd(command, self.debug) ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/vyos/util.py", line 161, in cmd raise OSError(code, feedback) PermissionError: [Errno 1] failed to run command: ip link set dev veth100 netns ns01 returned: exit code: 1 noteworthy: cmd 'ip link set dev veth100 netns ns01' returned (out): returned (err): Cannot find device "veth100" This reverts commit f5cc8453860568351cd9b3b7a05d06e1462460e8.
-rw-r--r--interface-definitions/interfaces-virtual-ethernet.xml.in1
-rw-r--r--python/vyos/ifconfig/interface.py2
2 files changed, 1 insertions, 2 deletions
diff --git a/interface-definitions/interfaces-virtual-ethernet.xml.in b/interface-definitions/interfaces-virtual-ethernet.xml.in
index a5702bfc0..864f658da 100644
--- a/interface-definitions/interfaces-virtual-ethernet.xml.in
+++ b/interface-definitions/interfaces-virtual-ethernet.xml.in
@@ -22,7 +22,6 @@
#include <include/interface/dhcpv6-options.xml.i>
#include <include/interface/disable.xml.i>
#include <include/interface/vrf.xml.i>
- #include <include/interface/netns.xml.i>
<leafNode name="peer-name">
<properties>
<help>Virtual ethernet peer interface name</help>
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 2f1d5eb96..f62b9f7d2 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -532,7 +532,7 @@ class Interface(Control):
return None
# As a PoC we only allow 'dummy' interfaces
- if not ('dum' in self.ifname or 'veth' in self.ifname):
+ if 'dum' not in self.ifname:
return None
# Check if interface realy exists in namespace