Skip to content

Commit

Permalink
vlan: update state flag
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
christophefontaine committed Jan 30, 2025
1 parent 65042b0 commit 2c093d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/infra/control/vlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 2c093d5

Please sign in to comment.