Skip to contentSkip to conversation

helpers: Fix for warning when compiling against libtirpc

PATCH In review Phil Sutter 3 participants 3 messages Nov 11, 2019 – Nov 12, 2019 netfilter

lore
Share & tools
lore

Phil Sutter

author reviewer
#0 lore raw

PATCH 1/1 helpers: Fix for warning when compiling against libtirpc

Fix for the following warning:

In file included from rpc.c:29:
/usr/include/tirpc/rpc/rpc_msg.h:214:52: warning: 'struct rpc_err' declared inside parameter list will not be visible outside of this definition or declaration
214 | extern void _seterr_reply(struct rpc_msg *, struct rpc_err *);
| ^~~~~~~

Struct rpc_err is declared in rpc/clnt.h which also declares rpc_call(), therefore rename the local version.

Fixes 5ededc4476f27 ("conntrackd: search for RPC headers")
---
 src/helpers/rpc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
src/helpers/rpc.c +4 -3
index 3a7b337135f04..bd24dd3269c8e 100644
@@ -26,6 +26,7 @@
 
 #include <errno.h>
 
+#include <rpc/clnt.h>
 #include <rpc/rpc_msg.h>
 #include <rpc/pmap_prot.h>
 #define _GNU_SOURCE
@@ -114,8 +115,8 @@ nf_nat_rpc(struct pkt_buff *pkt, int dir, struct nf_expect *exp,
 #define ROUNDUP(n)	((((n) + 3)/4)*4)
 
 static int
-rpc_call(const uint32_t *data, uint32_t offset, uint32_t datalen,
-	 struct rpc_info *rpc_info)
+rpc_parse_call(const uint32_t *data, uint32_t offset, uint32_t datalen,
+	       struct rpc_info *rpc_info)
 {
 	uint32_t p, r;
 
@@ -393,7 +394,7 @@ rpc_helper_cb(struct pkt_buff *pkt, uint32_t protoff,
 	}
 
 	if (rm_dir == CALL) {
-		if (rpc_call(data, offset, datalen, rpc_info) < 0)
+		if (rpc_parse_call(data, offset, datalen, rpc_info) < 0)
 			goto out;
 
 		rpc_info->xid = xid;
Signature · 1 line
2.24.0
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Phil Sutter

Fix for the following warning:

In file included from rpc.c:29:
/usr/include/tirpc/rpc/rpc_msg.h:214:52: warning: 'struct rpc_err' declared inside parameter list will not be visible outside of this definition or declaration
214 | extern void _seterr_reply(struct rpc_msg *, struct rpc_err *);
| ^~~~~~~

Quoted 9 lines

Struct rpc_err is declared in rpc/clnt.h which also declares rpc_call(), therefore rename the local version.

Fixes 5ededc4476f27 ("conntrackd: search for RPC headers")
---
 src/helpers/rpc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
maintainer Acked-by
#2 lore raw
Quoted 11 lines · Arturo Borrero Gonzalez
Quoted 10 lines · Phil Sutter

Fix for the following warning:

In file included from rpc.c:29:
/usr/include/tirpc/rpc/rpc_msg.h:214:52: warning: 'struct rpc_err' declared inside parameter list will not be visible outside of this definition or declaration
214 | extern void _seterr_reply(struct rpc_msg *, struct rpc_err *);
| ^~~~~~~

Struct rpc_err is declared in rpc/clnt.h which also declares rpc_call(), therefore rename the local version.

Quoted 8 lines
Quoted 6 lines
Fixes 5ededc4476f27 ("conntrackd: search for RPC headers")
---
 src/helpers/rpc.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)