Page MenuHomeFreeBSD

if_vlan: handle VID conflicts
ClosedPublic

Authored by kp on May 21 2024, 12:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 29, 5:02 AM
Unknown Object (File)
Sat, Oct 26, 8:57 PM
Unknown Object (File)
Tue, Oct 22, 5:36 AM
Unknown Object (File)
Sep 30 2024, 1:31 PM
Unknown Object (File)
Sep 30 2024, 1:29 PM
Unknown Object (File)
Sep 30 2024, 11:28 AM
Unknown Object (File)
Sep 25 2024, 12:27 AM
Unknown Object (File)
Sep 24 2024, 5:49 PM

Details

Summary

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
MFC atfer: 1 week
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.May 21 2024, 12:25 PM

Looks good to me.

sys/net/if_vlan.c
1727

Shall we assert check the return value of the re-inserting ? That should never fail.

This revision is now accepted and ready to land.May 21 2024, 2:20 PM
kp marked an inline comment as done.May 21 2024, 2:34 PM
kp added inline comments.
sys/net/if_vlan.c
1727

Yeah, good idea. I'll do that and push.

tests/sys/net/if_vlan.sh
318

${epair}a is not used by this test case, I think this line can be removed, only to reduce a little time for running tests...

This revision was automatically updated to reflect the committed changes.
kp marked an inline comment as done.