Skip to content

Commit 86d61d8

Browse files
Trond MyklebustTrond Myklebust
authored andcommitted
SUNRPC: Fix up constant string declarations in struct rpcbind_args
...and eliminate an unnecessary cast. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent b454ae9 commit 86d61d8

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

‎net/sunrpc/rpcb_clnt.c‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ struct rpcbind_args {
7373
u32 r_vers;
7474
u32 r_prot;
7575
unsigned short r_port;
76-
char * r_netid;
77-
char r_addr[RPCBIND_MAXUADDRLEN];
78-
char * r_owner;
76+
const char * r_netid;
77+
const char * r_addr;
78+
const char * r_owner;
7979
};
8080

8181
static struct rpc_procinfo rpcb_procedures2[];
@@ -358,10 +358,8 @@ void rpcb_getport_async(struct rpc_task *task)
358358
map->r_prot = xprt->prot;
359359
map->r_port = 0;
360360
map->r_xprt = xprt_get(xprt);
361-
map->r_netid = (char *)rpc_peeraddr2str(clnt, RPC_DISPLAY_NETID);
362-
memcpy(map->r_addr,
363-
rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR),
364-
sizeof(map->r_addr));
361+
map->r_netid = rpc_peeraddr2str(clnt, RPC_DISPLAY_NETID);
362+
map->r_addr = rpc_peeraddr2str(rpcb_clnt, RPC_DISPLAY_UNIVERSAL_ADDR);
365363
map->r_owner = RPCB_OWNER_STRING; /* ignored for GETADDR */
366364

367365
child = rpcb_call_async(rpcb_clnt, map, xprt->bind_index);

0 commit comments

Comments
 (0)