HomeFreeBSD

net: Allow binding of unspecified address without address existance

Description

net: Allow binding of unspecified address without address existance

Previously in_pcbbind_setup returned EADDRNOTAVAIL for empty
V_in_ifaddrhead (i.e., no IPv4 addresses configured) and in6_pcbbind
did the same for empty V_in6_ifaddrhead (no IPv6 addresses).

An equivalent test has existed since 4.4-Lite. It was presumably done
to avoid extra work (assuming the address isn't going to be found
later).

In normal system operation *_ifaddrhead will not be empty: they will
at least have the loopback address(es). In practice no work will be
avoided.

Further, this case caused net/dhcpd to fail when run early in boot
before assignment of any addresses. It should be possible to bind the
unspecified address even if no addresses have been configured yet, so
just remove the tests.

The now-removed "XXX broken" comments were added in 59562606b9d3,
which converted the ifaddr lists to TAILQs. As far as I (emaste) can
tell the brokenness is the issue described above, not some aspect of
the TAILQ conversion.

PR: 253166
Reviewed by: ae, bz, donner, emaste, glebius
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D32563

(cherry picked from commit 5c5340108e9c2e384ca646720e17d037c69acc4c)

Details

Provenance
roy_marples.nameAuthored on Oct 20 2021, 3:47 PM
emasteCommitted on Nov 19 2021, 12:29 AM
Reviewer
ae
Differential Revision
D32563: net: Allow binding of unspecified address without address existance
Parents
rG82d04e93821d: nfscl: Do pNFS layout return_on_close synchronously
Branches
Unknown
Tags
Unknown