diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-03-27 17:49:36 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-04-05 15:21:05 +0200 |
commit | e7c643c8c8b84619d78abfe05e490b644bd109bc (patch) | |
tree | 21bdf936ee536bd09024eea5a079701f192619fa /python/vyos/ifconfig | |
parent | 35e596811820dea92ed20759a2e8f4bd84a88c81 (diff) | |
download | vyos-1x-e7c643c8c8b84619d78abfe05e490b644bd109bc.tar.gz vyos-1x-e7c643c8c8b84619d78abfe05e490b644bd109bc.zip |
vrf: vlan: T3438: do not automatically delete upper interface
Removing a VLAN (VIF) interface from the CLI always deleted all interfaces the
kernel listed as "upper" in the /sys/class/net folder. This had the drawback
that when deleting a VIF, also the VRF interface was simply deleted - killing
all VRF related services.
(cherry picked from commit 6458f91735412fb2e6e7e37f7b3e6ca587a5a235)
Diffstat (limited to 'python/vyos/ifconfig')
-rw-r--r-- | python/vyos/ifconfig/interface.py | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py index 86fdba661..251d3fa88 100644 --- a/python/vyos/ifconfig/interface.py +++ b/python/vyos/ifconfig/interface.py @@ -1301,27 +1301,6 @@ class VLANIf(Interface): options = Interface.options + \ ['source_interface', 'vlan_id', 'protocol', 'ingress_qos', 'egress_qos'] - def remove(self): - """ - Remove interface from operating system. Removing the interface - deconfigures all assigned IP addresses and clear possible DHCP(v6) - client processes. - - Example: - >>> from vyos.ifconfig import Interface - >>> VLANIf('eth0.10').remove - """ - # Do we have sub interfaces (VLANs)? As interfaces need to be deleted - # "in order" starting from Q-in-Q we delete them first. - for upper in glob(f'/sys/class/net/{self.ifname}/upper*'): - # an upper interface could be named: upper_bond0.1000.1100, thus - # we need top drop the upper_ prefix - vif_c = os.path.basename(upper) - vif_c = vif_c.replace('upper_', '') - VLANIf(vif_c).remove() - - super().remove() - def _create(self): # bail out early if interface already exists if self.exists(f'{self.ifname}'): |