From 27a49079b03316eebcbc74197b73988b01b58ecc Mon Sep 17 00:00:00 2001 From: Chuck Lever Date: Thu, 5 Mar 2009 06:20:40 -0500 Subject: 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 Signed-off-by: Steve Dickson --- utils/statd/statd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'utils/statd/statd.c') diff --git a/utils/statd/statd.c b/utils/statd/statd.c index 321f7a9..6da2ab2 100644 --- a/utils/statd/statd.c +++ b/utils/statd/statd.c @@ -88,9 +88,11 @@ 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 (!check_default("statd", svc_getcaller(transp), - rqstp->rq_proc, SM_PROG)) { + if (sin->sin_family == AF_INET && + !check_default("statd", sin, rqstp->rq_proc, SM_PROG)) { svcerr_auth (transp, AUTH_FAILED); return; } -- cgit