freebsd-dev/usr.sbin/rpcbind
Warner Losh 923dd9a7a7 When you have multiple addresses on the same network on different
interfaces (such as when you are part of a carp pool), and you run
rpcbind -h to restrict which interfaces have rpc services, rpcbind can
none-the-less return addresses that aren't in the -h list.  This patch
enforces the rule that when you specify -h on the command line, then
services returned from rpcbind must be to one of the addresses listed
in -h, or be a loopback address (since localhost is implicit when
running -h).

The root cause of this is the assumption in addrmerge that there can
be only one interface that matches a given network IP address.  This
turns out not to be the case.  To retain historical behavior, I didn't
try to fix the routine to prefer the address that the request came
into, since I didn't know the side effects that might cause in the
normal case.  My quick analysis suggests that it wouldn't be a
problem, but since this code is tricky I opted for the more
conservative patch of only restricting the reply when -h is in effect.

Hence, this change will have no effect when you are running rpcbind
without -h.

Reviewed by:	alfred@
Sponsored by:	iX Systems
MFC after:	2 weeks
2010-02-09 18:10:56 +00:00
..
check_bound.c Cleanup of userland __P use 2007-11-07 10:53:41 +00:00
Makefile The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
pmap_svc.c Cleanup of userland __P use 2007-11-07 10:53:41 +00:00
rpcb_stat.c
rpcb_svc_4.c Cleanup of userland __P use 2007-11-07 10:53:41 +00:00
rpcb_svc_com.c Initialize fromlen before calling recvfrom to avoid passing in random 2010-02-07 07:50:41 +00:00
rpcb_svc.c Cleanup of userland __P use 2007-11-07 10:53:41 +00:00
rpcbind.8 1)Make it possible for rpcbind(8) to bind TCP listening socket to an IP 2007-04-23 07:09:25 +00:00
rpcbind.c When you have multiple addresses on the same network on different 2010-02-09 18:10:56 +00:00
rpcbind.h When you have multiple addresses on the same network on different 2010-02-09 18:10:56 +00:00
security.c
util.c When you have multiple addresses on the same network on different 2010-02-09 18:10:56 +00:00
warmstart.c Cleanup of userland __P use 2007-11-07 10:53:41 +00:00