]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r293229, r293833 to usr.sbin/rpcbind
authorasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 17 Mar 2016 20:00:49 +0000 (20:00 +0000)
committerasomers <asomers@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Thu, 17 Mar 2016 20:00:49 +0000 (20:00 +0000)
commita8a8e4e73f4e143fd329046dafa5619cb5cf89b2
tree3265216c00d3ea5686dc941ea3573ce3ef54fe0b
parentad15b015f7a378872afb5fb56d6f7a46ea9876bb
MFC r293229, r293833 to usr.sbin/rpcbind

r293833 | asomers | 2016-01-13 10:33:50 -0700 (Wed, 13 Jan 2016) | 16 lines

Fix Coverity warnings regarding r293229

rpcbind/check_bound.c
        Fix CID1347798, a memory leak in mergeaddr.

rpcbind/tests/addrmerge_test.c
        Fix CID1347800 through CID1347803, memory leaks in ATF tests.  They
        are harmless because each ATF test case runs in its own process, but
        they are trivial to fix.  Fix a few other leaks that Coverity didn't
        detect, too.

r293229 | asomers | 2016-01-05 17:00:11 -0700 (Tue, 05 Jan 2016) | 36 lines

"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

git-svn-id: svn://svn.freebsd.org/base/stable/10@296994 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
etc/mtree/BSD.tests.dist
usr.sbin/rpcbind/Makefile
usr.sbin/rpcbind/check_bound.c
usr.sbin/rpcbind/rpcbind.h
usr.sbin/rpcbind/tests/Makefile [new file with mode: 0644]
usr.sbin/rpcbind/tests/addrmerge_test.c [new file with mode: 0644]
usr.sbin/rpcbind/util.c