diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2009-03-05 06:20:40 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2009-03-05 06:20:40 -0500 |
commit | 27a49079b03316eebcbc74197b73988b01b58ecc (patch) | |
tree | f24ddd9ce2c3d2cb9cc508c9ce27ae966c79dc91 /utils/statd/monitor.c | |
parent | 5529fdbb4acb2507b79acf07e08c2a88c1df9e38 (diff) | |
download | nfs-utils-27a49079b03316eebcbc74197b73988b01b58ecc.tar.gz nfs-utils-27a49079b03316eebcbc74197b73988b01b58ecc.tar.xz nfs-utils-27a49079b03316eebcbc74197b73988b01b58ecc.zip |
nfs-utils: Provide type-checked version of svc_getcaller()
TI-RPC's version of the svc_getcaller() macro points to a sockaddr_in6,
not a sockaddr_in, though for AF_INET callers, an AF_INET address
resides there. To squelch compiler warnings when the TI-RPC version of
the svc_req structure is used, add inline helpers with appropriate
type casting.
Note that tcp_wrappers support only AF_INET addresses for now.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'utils/statd/monitor.c')
-rw-r--r-- | utils/statd/monitor.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/statd/monitor.c b/utils/statd/monitor.c index 24c2531..169cd78 100644 --- a/utils/statd/monitor.c +++ b/utils/statd/monitor.c @@ -20,6 +20,8 @@ #include <errno.h> #include <arpa/inet.h> #include <dirent.h> + +#include "rpcmisc.h" #include "misc.h" #include "statd.h" #include "notlist.h" @@ -36,9 +38,10 @@ notify_list * rtnl = NULL; /* Run-time notify list. */ static int caller_is_localhost(struct svc_req *rqstp) { + struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt); struct in_addr caller; - caller = svc_getcaller(rqstp->rq_xprt)->sin_addr; + caller = sin->sin_addr; if (caller.s_addr != htonl(INADDR_LOOPBACK)) { note(N_WARNING, "Call to statd from non-local host %s", |