Page MenuHomeFreeBSD

ifconfig: fix vlan/vlanproto reconfiguration
ClosedPublic

Authored by kp on Jul 19 2022, 2:43 AM.
Tags
None
Referenced Files
F102910152: D35848.id108308.diff
Mon, Nov 18, 3:29 PM
F102902632: D35848.diff
Mon, Nov 18, 1:04 PM
Unknown Object (File)
Fri, Nov 1, 3:01 AM
Unknown Object (File)
Sep 9 2024, 11:24 PM
Unknown Object (File)
Aug 26 2024, 2:15 AM
Unknown Object (File)
Aug 13 2024, 1:10 PM
Unknown Object (File)
Aug 13 2024, 1:10 PM
Unknown Object (File)
Aug 7 2024, 4:46 PM
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.