aboutsummaryrefslogtreecommitdiffstats
path: root/main/unfs3/unfs3-0.9.22-musl.patch
blob: 31f3c6abdc302242486aea64d01ff461faae4e9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- unfs3-0.9.22/daemon.c
+++ unfs3-0.9.22-musl/daemon.c
@@ -110,7 +110,8 @@
  */
 struct in_addr get_remote(struct svc_req *rqstp)
 {
-    return (svc_getcaller(rqstp->rq_xprt))->sin_addr;
+    struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt);
+    return sin->sin_addr;
 }
 
 /*
@@ -118,7 +119,8 @@
  */
 short get_port(struct svc_req *rqstp)
 {
-    return (svc_getcaller(rqstp->rq_xprt))->sin_port;
+    struct sockaddr_in *sin = nfs_getrpccaller_in(rqstp->rq_xprt);
+    return sin->sin_port;
 }
 
 /*
--- unfs3-0.9.22/daemon.h
+++ unfs3-0.9.22-musl/daemon.h
@@ -46,4 +46,9 @@
 extern int	opt_brute_force;
 extern int	opt_readable_executables;
 
+static inline struct sockaddr_in *nfs_getrpccaller_in(SVCXPRT *xprt)
+{
+	return (struct sockaddr_in *)svc_getcaller(xprt);
+}
+
 #endif