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)
Thu, Jul 31, 7:55 PM
Unknown Object (File)
Wed, Jul 23, 3:08 PM
Unknown Object (File)
Jun 18 2025, 12:21 PM
Unknown Object (File)
Jun 16 2025, 5:05 AM
Unknown Object (File)
Jun 15 2025, 4:24 PM
Unknown Object (File)
Jun 14 2025, 10:03 AM
Unknown Object (File)
Jun 13 2025, 5:42 AM
Unknown Object (File)
Jun 12 2025, 5:40 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 Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/netinet/in_pcb.c
2188

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
981

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

sys/netinet/in_pcb.c
2188

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
981

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.