Fix the client IP address reported by nfsdumpstate for 64bit arch and NFSv4.1.
authorrmacklem <rmacklem@FreeBSD.org>
Sun, 15 Oct 2017 22:22:27 +0000 (22:22 +0000)
committerrmacklem <rmacklem@FreeBSD.org>
Sun, 15 Oct 2017 22:22:27 +0000 (22:22 +0000)
commitda67d313c553e5b04a7ee3952df5c899b0c9fa68
treed6313a3ae09d8afc0abe2bd48d89cc885697ae25
parent55148538359ca83ecac0e4ff4120885c6e0ac143
Fix the client IP address reported by nfsdumpstate for 64bit arch and NFSv4.1.

The client IP address was not being reported for some NFSv4 mounts by
nfsdumpstate. Upon investigation, two problems were found for mounts
using IPv4. One was that the code (originally written and tested on i386)
assumed that a "u_long" was a "uint32_t" and would exactly store an
IPv4 host address. Not correct for 64bit arches.
Also, for NFSv4.1 mounts, the field was not being filled in. This was
basically correct, because NFSv4.1 does not use a callback address.
However, it meant that nfsdumpstate could not report the client IP addr.
This patch should fix both of these issues.
For IPv6, the address will still not be reported. The original NFSv4 RFC
only specified IPv4 callback addresses. I think this has changed and, if so,
a future commit to fix reporting of IPv6 addresses will be needed.

Reported by: manu
PR: 223036
MFC after: 2 weeks
sys/fs/nfsserver/nfs_nfsdserv.c
sys/fs/nfsserver/nfs_nfsdstate.c