Page MenuHomeFreeBSD

netinet6: refactor in6_pcbconnect()
AcceptedPublic

Authored by glebius on Wed, Jun 10, 6:40 PM.
Tags
None
Referenced Files
F159299378: D57534.diff
Fri, Jun 12, 2:27 PM
Unknown Object (File)
Thu, Jun 11, 4:23 AM
Unknown Object (File)
Thu, Jun 11, 4:23 AM
Subscribers

Details

Reviewers
pouria
Group Reviewers
network
transport
Summary

If the inpcb is already bound to a local address, there is no reason to
call in6_pcbladdr(). If the inpcb is already bound to a local port, there
is no reason to call in_pcb_lport_dest(). In the opposite case, if the
inpcb is not bound, and we are about to choose a non-conflicting local
addr:port, then there is no reason to call in6_pcblookup_internal().

This change makes in6_pcbconnect() to look much more alike the IPv4
in_pcbconnect(). I tracked this strange logic all the way down to initial
KAME import and failed to find any reasoning for it.

Diff Detail

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

Event Timeline

I suspected the IPV6_PKTINFO option might change the source address after binding to a local address, but this turned out not to be the case.
LGTM.

This revision is now accepted and ready to land.Fri, Jun 12, 12:22 PM