Page MenuHomeFreeBSD

if_vlan: handle VID conflicts
ClosedPublic

Authored by kp on Tue, May 21, 12:25 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jun 2, 9:22 AM
Unknown Object (File)
Wed, May 29, 6:22 PM
Unknown Object (File)
Sun, May 26, 7:53 AM
Unknown Object (File)
Sat, May 25, 1:13 PM
Unknown Object (File)
Sat, May 25, 1:12 PM
Unknown Object (File)
Sat, May 25, 6:13 AM
Unknown Object (File)
Thu, May 23, 5:21 PM
Unknown Object (File)
Wed, May 22, 9:24 AM

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.Tue, May 21, 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.Tue, May 21, 2:20 PM
kp marked an inline comment as done.Tue, May 21, 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.