summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/mount3udp_svc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/nfs/server/src/mount3udp_svc.c')
-rw-r--r--xlators/nfs/server/src/mount3udp_svc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/mount3udp_svc.c b/xlators/nfs/server/src/mount3udp_svc.c
index e8e226e953e..8256a5970bb 100644
--- a/xlators/nfs/server/src/mount3udp_svc.c
+++ b/xlators/nfs/server/src/mount3udp_svc.c
@@ -133,7 +133,19 @@ mountudp_program_3(struct svc_req *rqstp, register SVCXPRT *transp)
mountres3 *res = NULL;
struct sockaddr_in *sin = NULL;
+#if !defined(_TIRPC_SVC_H)
sin = svc_getcaller (transp);
+#else
+ sin = (struct sockaddr_in *)svc_getcaller (transp);
+ /* TIRPC's svc_getcaller() returns a pointer to a sockaddr_in6, even
+ * though it might actually be an IPv4 address. It ought return a
+ * struct sockaddr and make the caller upcast it to the proper
+ * address family. Sigh.
+ */
+#endif
+ /* And let's make sure that it's actually an IPv4 address. */
+ GF_ASSERT (sin->sin_family == AF_INET);
+
inet_ntop (AF_INET, &sin->sin_addr, mnthost, INET_ADDRSTRLEN+1);
switch (rqstp->rq_proc) {