diff options
| author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2025-10-10 12:34:27 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-10 12:34:27 +0300 |
| commit | f35c980de595ee6adc8b5b28b913224564ee2d94 (patch) | |
| tree | 2fc26d3d8af3e3c105d49a5c0577ea264eb49690 /python | |
| parent | c8759c0f89f36b9a4b603fb9587f9c2f6709edd6 (diff) | |
| parent | 308998759f26032ed055cd8c2eabd5d3693bd594 (diff) | |
| download | vyos-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.py | 3 |
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}' |
