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 --- support/include/rpcmisc.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'support/include') diff --git a/support/include/rpcmisc.h b/support/include/rpcmisc.h index 5814a63..f551a85 100644 --- a/support/include/rpcmisc.h +++ b/support/include/rpcmisc.h @@ -53,5 +53,14 @@ extern int _rpcpmstart; extern int _rpcfdtype; extern int _rpcsvcdirty; +static inline struct sockaddr_in *nfs_getrpccaller_in(SVCXPRT *xprt) +{ + return (struct sockaddr_in *)svc_getcaller(xprt); +} + +static inline struct sockaddr *nfs_getrpccaller(SVCXPRT *xprt) +{ + return (struct sockaddr *)svc_getcaller(xprt); +} #endif /* RPCMISC_H */ -- cgit