From 516ea43279d750272be398a27948049581b22630 Mon Sep 17 00:00:00 2001 From: zdc Date: Wed, 18 Jun 2025 11:51:34 +0300 Subject: XDP/Mellanox: T7223: Fixed interfaces initialization For the XDP driver and Mellanox NIC, we create `defunct_*` interfaces to hide original interfaces from CLI, when they are replaced with VPP-enabled pairs. But sometimes IP addresses are not flushed from these `defunct_*` interfaces, which leads to broken routing afterward. This commit introduces an additional flush operation for `defunct_*` interfaces to ensure that they do not conflict with VPP interfaces. --- python/vyos/vpp/control_host.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'python') diff --git a/python/vyos/vpp/control_host.py b/python/vyos/vpp/control_host.py index ead9f6968..1ac004fbb 100644 --- a/python/vyos/vpp/control_host.py +++ b/python/vyos/vpp/control_host.py @@ -21,6 +21,8 @@ from re import fullmatch as re_fullmatch from subprocess import run from time import sleep +from pyroute2 import IPRoute + from vyos.vpp.utils import EthtoolGDrvinfo @@ -361,3 +363,13 @@ def set_status(iface_name: str, status: str) -> None: status (str): status - "up" or "down" """ run(['ip', 'link', 'set', iface_name, status]) + + +def flush_ip(iface_name: str) -> None: + """Flush IP addresses from an interface + + Args: + iface_name (str): name of an interface + """ + iproute = IPRoute() + iproute.flush_addr(label=iface_name) -- cgit v1.2.3