From 2c093d57832ad417ea70a89edaef6fccac31eb81 Mon Sep 17 00:00:00 2001 From: Christophe Fontaine Date: Thu, 30 Jan 2025 10:52:43 +0000 Subject: [PATCH] vlan: update state flag vlan interfaces do not report their "running" state. \# grcli show interface all NAME ID FLAGS VRF TYPE INFO dpdk-p0 1 up running 0 port devargs=0000:05:00.0 mac=3c:fd:fe:a0:a4:c4 gr-loop0 2 up running 0 loopback dpdk-p1 3 up running 0 port devargs=0000:08:00.0 mac=90:e2:ba:14:2f:8c vlan210 4 up 0 vlan parent=dpdk-p1 vlan_id=210 vlan211 5 up 0 vlan parent=dpdk-p0 vlan_id=211 Until we have a proper "admin up/down" config state, update the running state when the parent interface goes up/down. Signed-off-by: Christophe Fontaine --- modules/infra/control/vlan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/infra/control/vlan.c b/modules/infra/control/vlan.c index 5310dc13..bb8797d9 100644 --- a/modules/infra/control/vlan.c +++ b/modules/infra/control/vlan.c @@ -277,8 +277,10 @@ static void port_event(iface_event_t event, struct iface *iface) { if (info->parent_id == iface->id) { if (event == IFACE_EVENT_STATUS_UP) { vlan->flags |= GR_IFACE_F_UP; + vlan->state |= GR_IFACE_S_RUNNING; } else { vlan->flags &= ~GR_IFACE_F_UP; + vlan->state &= ~GR_IFACE_S_RUNNING; } iface_event_notify(event, vlan); }