Page MenuHomeFreeBSD

ifconfig: fix vlan/vlanproto reconfiguration
ClosedPublic

Authored by kp on Jul 19 2022, 2:43 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 23, 3:30 PM
Unknown Object (File)
May 13 2024, 8:14 PM
Unknown Object (File)
May 13 2024, 8:13 PM
Unknown Object (File)
May 13 2024, 6:25 PM
Unknown Object (File)
May 13 2024, 4:18 PM
Unknown Object (File)
Jan 17 2024, 11:11 PM
Unknown Object (File)
Jan 15 2024, 9:22 PM
Unknown Object (File)
Jan 14 2024, 10:24 AM
Subscribers

Details

Summary

The setvlantag() and setvlanproto() functions are used in two scenarios:
when we create a new vlan interface and when we update an existing
interface.
These are distinguished by the getvlan() at the end of the functions. If
this fails we assume that is because the interface doesn't exist (so
we're creating a new one). We only update the 'params' struct, and
expect the settings to be applied when we vlan_create().

However, if we're updating an existing interface we do not retrieve the
current settings, and can end up invalidating settings.

Fix this by using the settings we retrieved while checking which
scenario we're in.

Note that we do not address this for setvlandev(), because if_vlan does
not allow the vlan parent device to be changed without disassociating it
first (with ifconfig vlanX -vlandev).

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp requested review of this revision.Jul 19 2022, 2:43 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 21 2022, 4:37 PM
This revision was automatically updated to reflect the committed changes.