Page MenuHomeFreeBSD

netinet6: refactor in6_pcbconnect()
ClosedPublic

Authored by glebius on Wed, Jun 10, 6:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jul 5, 2:08 PM
Unknown Object (File)
Sun, Jul 5, 6:18 AM
Unknown Object (File)
Tue, Jun 30, 9:29 AM
Unknown Object (File)
Tue, Jun 30, 9:27 AM
Unknown Object (File)
Tue, Jun 30, 7:23 AM
Unknown Object (File)
Tue, Jun 30, 7:20 AM
Unknown Object (File)
Sat, Jun 27, 7:09 PM
Unknown Object (File)
Sat, Jun 27, 7:04 PM
Subscribers

Details

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 Not Applicable
Unit
Tests Not Applicable

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
This revision was automatically updated to reflect the committed changes.