Page MenuHomeFreeBSD

netinet6: further refactor in6_pcbconnect()
ClosedPublic

Authored by glebius on Jul 1 2026, 5:54 AM.
Tags
None
Referenced Files
F174869018: D57987.id181455.diff
Tue, Oct 6, 4:11 PM
Unknown Object (File)
Tue, Oct 6, 1:41 AM
Unknown Object (File)
Sun, Oct 4, 6:29 AM
Unknown Object (File)
Sun, Oct 4, 6:28 AM
Unknown Object (File)
Sun, Oct 4, 2:31 AM
Unknown Object (File)
Fri, Oct 2, 9:19 PM
Unknown Object (File)
Thu, Oct 1, 2:31 AM
Unknown Object (File)
Wed, Sep 30, 4:39 AM
Subscribers

Details

Summary

A mistake from 90ea8e89d9b7 is that in6_pcblookup_internal() was skipped
for an inpcb that had unspecified local address. This is incorrect, as
such inpcb could have already have a port set, and in_pcb_lport_dest()
shall not be called on such inpcb. That could lead to creation of an
alised connection in the database.

This makes the function almost identical to in_pcbconnect(). While here,
fix minor bug of missing INP_ANONPORT. This flag has no use in kernel,
but affects netstat(1) output in certain mode.

Fixes: 90ea8e89d9b751e8b5ae90ef3397883b035788e5

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable