From 8e710e90bcf937d500445082800503f374560399 Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Fri, 15 Jan 2010 16:02:49 -0500 Subject: tcpwrapper: Add support for IPv6 Assuming the tcp_wrappers library can actually support IPv6 addresses, here's a crack at IPv6 support in nfs-utils' TCP wrapper shim. Some reorganization is done to limit the number of times that @sap is converted to a presentation address string. Signed-off-by: Chuck Lever --- utils/mountd/mount_dispatch.c | 6 ++---- utils/statd/statd.c | 5 +---- utils/statd/statd.man | 3 --- 3 files changed, 3 insertions(+), 11 deletions(-) (limited to 'utils') diff --git a/utils/mountd/mount_dispatch.c b/utils/mountd/mount_dispatch.c index d2802ef..ba6981d 100644 --- a/utils/mountd/mount_dispatch.c +++ b/utils/mountd/mount_dispatch.c @@ -70,12 +70,10 @@ mount_dispatch(struct svc_req *rqstp, SVCXPRT *transp) { union mountd_arguments argument; union mountd_results result; -#ifdef HAVE_TCP_WRAPPER - struct sockaddr_in *sin = nfs_getrpccaller_in(transp); +#ifdef HAVE_TCP_WRAPPER /* remote host authorization check */ - if (sin->sin_family == AF_INET && - !check_default("mountd", sin, MOUNTPROG)) { + if (!check_default("mountd", nfs_getrpccaller(transp), MOUNTPROG)) { svcerr_auth (transp, AUTH_FAILED); return; } diff --git a/utils/statd/statd.c b/utils/statd/statd.c index fa3c6d5..01fdb41 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -75,11 +75,8 @@ extern void simulator (int, char **); static void sm_prog_1_wrapper (struct svc_req *rqstp, register SVCXPRT *transp) { - struct sockaddr_in *sin = nfs_getrpccaller_in(transp); - /* remote host authorization check */ - if (sin->sin_family == AF_INET && - !check_default("statd", sin, SM_PROG)) { + if (!check_default("statd", nfs_getrpccaller(transp), SM_PROG)) { svcerr_auth (transp, AUTH_FAILED); return; } diff --git a/utils/statd/statd.man b/utils/statd/statd.man index 4ddb634..ffc5e95 100644 --- a/utils/statd/statd.man +++ b/utils/statd/statd.man @@ -274,9 +274,6 @@ listeners using the .B tcp_wrapper library or .BR iptables (8). -Note that the -.B tcp_wrapper -library supports only IPv4 networking. To use the .B tcp_wrapper library, add the hostnames of peers that should be allowed access to -- cgit