]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix nfsuserd so that it handles the mapped localhost address when jails
authorrmacklem <rmacklem@FreeBSD.org>
Sat, 6 Apr 2019 22:05:51 +0000 (22:05 +0000)
committerrmacklem <rmacklem@FreeBSD.org>
Sat, 6 Apr 2019 22:05:51 +0000 (22:05 +0000)
commit9867ff046ae960b64768e931253578550b953ff9
treefb82d9ef5fe497b512e568f0bf750e9b596b63a0
parent16397b2576160796e330a705c56ab5f42096958a
Fix nfsuserd so that it handles the mapped localhost address when jails
are enabled.

The nfsuserd(8) daemon does not function correctly when jails are enabled,
since localhost gets mapped to another IP address and, as such, the upcall
RPC fails.
This patch fixes the problem by doing a getsockname(2) of a socket mapped
to localhost to find out what the correct address is for the comparison
test with the upcall's from IP address.
This patch also adds INET6 support and the required #ifdef's for INET and
INET6. It now uses INET6 by default for the upcalls, if the kernel has
INET6 support and the daemon is also built with INET6 support.

Tested by: freebsd@danielengel.com (earlier version)
PR: 205193
Reviewed by: bz, rgrimes
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D19218
usr.sbin/nfsuserd/Makefile
usr.sbin/nfsuserd/nfsuserd.c