summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2025-10-10 12:34:27 +0300
committerGitHub <noreply@github.com>2025-10-10 12:34:27 +0300
commitf35c980de595ee6adc8b5b28b913224564ee2d94 (patch)
tree2fc26d3d8af3e3c105d49a5c0577ea264eb49690 /python
parentc8759c0f89f36b9a4b603fb9587f9c2f6709edd6 (diff)
parent308998759f26032ed055cd8c2eabd5d3693bd594 (diff)
downloadvyos-1x-f35c980de595ee6adc8b5b28b913224564ee2d94.tar.gz
vyos-1x-f35c980de595ee6adc8b5b28b913224564ee2d94.zip
Merge pull request #4784 from c-po/pppoe-flush
vyos.ifconfig: T7919: call "ip addr flush" only if interface exists
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/interface.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/python/vyos/ifconfig/interface.py b/python/vyos/ifconfig/interface.py
index 8101fdcc3..761ba1799 100644
--- a/python/vyos/ifconfig/interface.py
+++ b/python/vyos/ifconfig/interface.py
@@ -1354,6 +1354,9 @@ class Interface(Control):
self.set_dhcp(False)
self.set_dhcpv6(False)
+ if not self.exists(self.ifname):
+ return
+
netns = get_interface_namespace(self.ifname)
netns_cmd = f'ip netns exec {netns}' if netns else ''
cmd = f'{netns_cmd} ip addr flush dev {self.ifname}'