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
F105080306: D38571.diff
Thu, Dec 12, 5:11 AM
Unknown Object (File)
Tue, Nov 26, 4:16 AM
Unknown Object (File)
Tue, Nov 26, 4:16 AM
Unknown Object (File)
Tue, Nov 26, 4:16 AM
Unknown Object (File)
Tue, Nov 26, 3:48 AM
Unknown Object (File)
Nov 9 2024, 5:52 PM
Unknown Object (File)
Oct 18 2024, 12:51 AM
Unknown Object (File)
Oct 4 2024, 9:25 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.