freebsd-dev/usr.sbin/rpcbind
Alan Somers a85f12322c "source routing" in rpcbind
Fix a bug in rpcbind for multihomed hosts. If the server had interfaces on
two separate subnets, and a client on the first subnet contacted rpcbind at
the address on the second subnet, rpcbind would advertise addresses on the
first subnet. This is a bug, because it should prefer to advertise the
address where it was contacted. The requested service might be firewalled
off from the address on the first subnet, for example.

usr.sbin/rpcbind/check_bound.c
	If the address on which a request was received is known, pass that
	to addrmerge as the clnt_uaddr parameter. That is what addrmerge's
	comment indicates the parameter is supposed to mean. The previous
	behavior is that clnt_uaddr would contain the address from which the
	client sent the request.

usr.sbin/rpcbind/util.c
	Modify addrmerge to prefer to use an IP that is equal to clnt_uaddr,
	if one is found. Refactor the relevant portion of the function for
	clarity, and to reduce the number of ifdefs.

etc/mtree/BSD.tests.dist
usr.sbin/rpcbind/tests/Makefile
usr.sbin/rpcbind/tests/addrmerge_test.c
	Add unit tests for usr.sbin/rpcbind/util.c:addrmerge.

usr.sbin/rpcbind/check_bound.c
usr.sbin/rpcbind/rpcbind.h
usr.sbin/rpcbind/util.c
	Constify some function arguments

Reviewed by:	imp
MFC after:	4 weeks
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4690
2016-01-06 00:00:11 +00:00
..
tests "source routing" in rpcbind 2016-01-06 00:00:11 +00:00
check_bound.c "source routing" in rpcbind 2016-01-06 00:00:11 +00:00
Makefile "source routing" in rpcbind 2016-01-06 00:00:11 +00:00
Makefile.depend Add META_MODE support. 2015-06-13 19:20:56 +00:00
pmap_svc.c Replace Sun RPC license with a 3-clause BSD license, with the explicit 2013-11-25 16:44:02 +00:00
rpcb_stat.c Replace Sun RPC license with a 3-clause BSD license, with the explicit 2013-11-25 16:44:02 +00:00
rpcb_svc_4.c Replace Sun RPC license with a 3-clause BSD license, with the explicit 2013-11-25 16:44:02 +00:00
rpcb_svc_com.c Reallocate a maxlen-long buffer only when the current maxlen is 2015-10-06 08:43:48 +00:00
rpcb_svc.c Replace Sun RPC license with a 3-clause BSD license, with the explicit 2013-11-25 16:44:02 +00:00
rpcbind.8 Disable libwrap (TCP wrappers) support in rpcbind by default, introducing 2014-03-06 17:33:27 +00:00
rpcbind.c Disable libwrap (TCP wrappers) support in rpcbind by default, introducing 2014-03-06 17:33:27 +00:00
rpcbind.h "source routing" in rpcbind 2016-01-06 00:00:11 +00:00
security.c Disable libwrap (TCP wrappers) support in rpcbind by default, introducing 2014-03-06 17:33:27 +00:00
util.c "source routing" in rpcbind 2016-01-06 00:00:11 +00:00
warmstart.c Replace Sun RPC license with a 3-clause BSD license, with the explicit 2013-11-25 16:44:02 +00:00