From 20fb08d5258f2324433dd465257bcd65e8fe12c2 Mon Sep 17 00:00:00 2001 From: Shreyas Siravara Date: Wed, 18 Mar 2015 11:02:18 -0700 Subject: rpc: update tirpc registration to "force" unregister old mapping before re-registering > Reviewed-on: https://review.gluster.org/16849 > Reviewed-by: Shreyas Siravara Change-Id: I05ed6b7c715a71e5819fbe8116e7c3146010f836 BUG: 1521030 Signed-off-by: Kevin Vigor Signed-off-by: Amar Tumballi --- rpc/rpc-lib/src/rpcsvc.c | 6 ++++++ rpc/rpc-lib/src/rpcsvc.h | 2 ++ 2 files changed, 8 insertions(+) (limited to 'rpc/rpc-lib/src') diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 34e7563e163..2c7a3be8307 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -1452,6 +1452,12 @@ rpcsvc_program_register_rpcbind6 (rpcsvc_program_t *newprog, uint32_t port) goto out; } + /* Force the unregistration of the program first. + * This call may fail if nothing has been registered, + * which is fine. + */ + rpcsvc_program_unregister_rpcbind6 (newprog); + success = rpcb_set (newprog->prognum, newprog->progver, nc, nb); if (!success) { gf_log (GF_RPCSVC, GF_LOG_ERROR, "Could not register the IPv6" diff --git a/rpc/rpc-lib/src/rpcsvc.h b/rpc/rpc-lib/src/rpcsvc.h index dfd19845f5e..7ed0dca2ad0 100644 --- a/rpc/rpc-lib/src/rpcsvc.h +++ b/rpc/rpc-lib/src/rpcsvc.h @@ -465,6 +465,8 @@ rpcsvc_program_register_portmap (rpcsvc_program_t *newprog, uint32_t port); #ifdef IPV6_DEFAULT extern int rpcsvc_program_register_rpcbind6 (rpcsvc_program_t *newprog, uint32_t port); +extern int +rpcsvc_program_unregister_rpcbind6 (rpcsvc_program_t *newprog); #endif extern int -- cgit