HomeFreeBSD

if_vlan: handle VID conflicts

Description

if_vlan: handle VID conflicts

If we fail to change the vlan id we have to undo the removal (and vlan id
change) in the error path. Otherwise we'll have removed the vlan object from the
hash table, and have the wrong vlan id as well. Subsequent modification attempts
will then try to remove an entry which doesn't exist, and panic.

Undo the vlan id modification if the insertion in the hash table fails, and
re-insert it under the original vlan id.

PR: 279195
Reviewed by: zlei
MFC atfer: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D45285

(cherry picked from commit bdd12889eaa64032b3d09ef47e9a6f7081863378)

Details

Provenance
kpAuthored on May 21 2024, 11:31 AM
Reviewer
zlei
Differential Revision
D45285: if_vlan: handle VID conflicts
Parents
rGc1782c2d28a5: xen-netfront: attempt to make cleanup idempotent
Branches
Unknown
Tags
Unknown