HomeFreeBSD

MFC 53729367d388: Fix subinterface vlan creation.

Description

MFC 53729367d388: Fix subinterface vlan creation.

D26436 introduced support for stacked vlans that changed the way vlans
are configured. In particular, this change broke setups that have
same-number vlans as subinterfaces.

Vlan support was initially created assuming "vlanX" semantics. In this paradigm,
automatic number assignment supported by cloning (ifconfig vlan create) was a
natural fit.
When "ifaceX.Y" support was added, allowing to have the same vlan number on
multiple devices, cloning code became more complex, as the is no
unified "vlan" namespace anymore. Such interfaces got the first spare
index from "vlan" cloner. This, in turn, led to the following problem:
ifconfig ix0.333 create -> index 1
ifconfig ix0.444 create -> index 2
ifconfig vlan2 create -> allocation failure

This change fixes such allocations by using cloning indexes only for
"vlanX" interfaces.

Reviewed by: hselasky
Differential Revision: https://reviews.freebsd.org/D27505

Details

Provenance
melifaroAuthored on Jan 26 2021, 7:22 AM
Reviewer
hselasky
Differential Revision
D27505: Fix subinterface vlan creation.
Parents
rG87cefd5c3dc6: MFC eb0b1b33: Enable multipath routing by default.
Branches
Unknown
Tags
Unknown