diff options
author | Christian Breunig <christian@breunig.cc> | 2024-07-25 08:09:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-25 08:09:24 +0200 |
commit | 8e4d0d26850692542f7e1155bcbfd982a786e0b2 (patch) | |
tree | a60c2335da6c9e021b23fa6d862df3c8576b2a91 /python/vyos/ifconfig/l2tpv3.py | |
parent | 67695c3e7a0d9fdc10ad3e381ad67cb30688e217 (diff) | |
parent | 28fedd4e76bbea2b174159ee7b67ddda5e952ab5 (diff) | |
download | vyos-1x-8e4d0d26850692542f7e1155bcbfd982a786e0b2.tar.gz vyos-1x-8e4d0d26850692542f7e1155bcbfd982a786e0b2.zip |
Merge pull request #3871 from vyos/mergify/bp/circinus/pr-3857
interface: T6592: remove interface from conntrack ct_iface_map on deletion (backport #3857)
Diffstat (limited to 'python/vyos/ifconfig/l2tpv3.py')
-rw-r--r-- | python/vyos/ifconfig/l2tpv3.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/python/vyos/ifconfig/l2tpv3.py b/python/vyos/ifconfig/l2tpv3.py index 85a89ef8b..c1f2803ee 100644 --- a/python/vyos/ifconfig/l2tpv3.py +++ b/python/vyos/ifconfig/l2tpv3.py @@ -90,9 +90,17 @@ class L2TPv3If(Interface): """ if self.exists(self.ifname): - # interface is always A/D down. It needs to be enabled explicitly self.set_admin_state('down') + # remove all assigned IP addresses from interface - this is a bit redundant + # as the kernel will remove all addresses on interface deletion + self.flush_addrs() + + # remove interface from conntrack VRF interface map, here explicitly and do not + # rely on the base class implementation as the interface will + # vanish as soon as the l2tp session is deleted + self._del_interface_from_ct_iface_map() + if {'tunnel_id', 'session_id'} <= set(self.config): cmd = 'ip l2tp del session tunnel_id {tunnel_id}' cmd += ' session_id {session_id}' @@ -101,3 +109,5 @@ class L2TPv3If(Interface): if 'tunnel_id' in self.config: cmd = 'ip l2tp del tunnel tunnel_id {tunnel_id}' self._cmd(cmd.format(**self.config)) + + # No need to call the baseclass as the interface is now already gone |