From 9f55b277b2d3d19a68c3d993cd03b92aefa0e9d5 Mon Sep 17 00:00:00 2001 From: Shreyas Siravara Date: Wed, 18 Mar 2015 11:02:18 -0700 Subject: Update tirpc registration to "force" unregister old mapping before re-registering Summary: Per title Test Plan: Run prove tests to make sure we didn't break anything Reviewers: dph, rwareing Reviewed By: rwareing FB-commit-id: 78a9a0c Change-Id: I05ed6b7c715a71e5819fbe8116e7c3146010f836 Signed-off-by: Kevin Vigor Reviewed-on: https://review.gluster.org/16849 CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System Smoke: Gluster Build System Reviewed-by: Shreyas Siravara --- rpc/rpc-lib/src/rpcsvc.c | 6 ++++++ rpc/rpc-lib/src/rpcsvc.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/rpc/rpc-lib/src/rpcsvc.c b/rpc/rpc-lib/src/rpcsvc.c index 9dc3bff427c..ed23f547e53 100644 --- a/rpc/rpc-lib/src/rpcsvc.c +++ b/rpc/rpc-lib/src/rpcsvc.c @@ -1403,6 +1403,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 1032df03b0e..33141256cf3 100644 --- a/rpc/rpc-lib/src/rpcsvc.h +++ b/rpc/rpc-lib/src/rpcsvc.h @@ -440,6 +440,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