Skip to content

Conversation

yangbolu1991
Copy link
Member

Some fix-up for NET VLAN

There was call trace to execute "net vlan" if vlan interface
hadn't been enabled. Fixed it.

Signed-off-by: Yangbo Lu <[email protected]>
There were two problems about vlan interface naming currently.

1. When there were more than 1 vlan interfaces. It's not able to
   initialze name for all of them to same name VLAN-<free>.
2. When enabled vlan with tag, the name VLAN-xxx was used.
   However we may need to support multiple physical interfaces
   in the future. So, it's not able to use same name VLAN-xxx
   either for same tag on different physical interfaces.

Signed-off-by: Yangbo Lu <[email protected]>
Used simple vethX for vlan interface name. What interface the
vlan interface was attached to could be checked by "net iface"
or "net vlan".

Signed-off-by: Yangbo Lu <[email protected]>
Copy link

sonarqubecloud bot commented Sep 2, 2025

Copy link
Member

@jukkar jukkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok, minor comment about the interface naming.

(net_if_l2(iface) == &NET_L2_GET_NAME(VIRTUAL))) {
static int count;

snprintk(name, sizeof(name), "veth%d", count++);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer that the default name is vlan%d for the VLAN interfaces

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants