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
Unknown Object (File)
Sat, Oct 18, 8:10 AM
Unknown Object (File)
Sun, Oct 12, 4:14 AM
Unknown Object (File)
Sun, Oct 12, 3:19 AM
Unknown Object (File)
Sat, Oct 11, 9:23 AM
Unknown Object (File)
Sat, Oct 11, 9:23 AM
Unknown Object (File)
Sat, Oct 11, 1:48 AM
Unknown Object (File)
Sep 16 2025, 8:09 AM
Unknown Object (File)
Sep 14 2025, 10:37 PM
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.