Bug 219674 - rpcbind -h breaks broadcast functionality
Summary: rpcbind -h breaks broadcast functionality
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-net (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-05-31 08:34 UTC by Andriy Gapon
Modified: 2021-02-16 21:54 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andriy Gapon freebsd_committer freebsd_triage 2017-05-31 08:34:12 UTC
If rpcbind is started with -h <ip-addr> option, then it does not receive any broadcast traffic.  This is because the FreeBSD UDP stack passes an incoming broadcast packet to a socket only if the socket is bound to either the INADDR_ANY or to the same broadcast IP address as in the packet's destination.

Thus, any RPC services depending on the broadcast functionality stop working.
For example, ypbind is no longer able to discover ypserv(-s).

This behaviour is not documented at all neither in man pages nor in the handbook (https://www.freebsd.org/doc/handbook/network-nis.html).  At minimum, the issue deserves a big warning, at maximum there should be an example of the configuration tweaks required to work around the problem (e.g. using ypset, etc).

Ideally, though, rpcbind should bind to each broadcast address matching any IP address passed via -h.
Alternatively, we could add a socket option to allow a UDP socket to see the matching [the interface] broadcast traffic in addition to the traffic destined to the bound IP address.