Page MenuHomeFreeBSD

inpcb: Factor out inpcb matching logic into functions
ClosedPublic

Authored by markj on Feb 13 2023, 11:16 PM.
Tags
None
Referenced Files
F115206707: D38571.diff
Mon, Apr 21, 10:37 AM
Unknown Object (File)
Thu, Apr 17, 2:25 PM
Unknown Object (File)
Sun, Mar 30, 12:41 PM
Unknown Object (File)
Feb 10 2025, 5:14 PM
Unknown Object (File)
Feb 9 2025, 12:52 AM
Unknown Object (File)
Jan 27 2025, 5:18 PM
Unknown Object (File)
Jan 27 2025, 5:11 PM
Unknown Object (File)
Jan 27 2025, 4:05 AM
Subscribers

Details

Summary

These functions will get some additional callers in future revisions.

No functional change intended.

Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 49753
Build 46643: arc lint + arc unit

Event Timeline

sys/netinet/in_pcb.c
2232

We've been copying this XXX comment over and over. I think it originates from Robert Watson original SMP work. I don't think inp_vflag ever changes and the comment should be removed.

sys/netinet6/in6_pcb.c
998

Maybe move the declaration to in_pcb_var.h to avoid declaring twice?

sys/netinet/in_pcb.c
2232

It does change, see the IPV6_V6ONLY socket option handler, for example.

In fact we had several legitimate bugs caused by unlocked checks of this flag. I think this particular instance of the warning can be removed: in the full patch set, we re-validate address fields and the vflag after the inpcb lock is acquired.

sys/netinet6/in6_pcb.c
998

At one point these were slightly different: v4 has special logic for 4in6 sockets and I had an extra enum value for them. It might make sense to keep them separate for cases like that.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 20 2023, 4:14 PM
This revision was automatically updated to reflect the committed changes.