Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 139559
b: refs/heads/master
c: d5a8620
h: refs/heads/master
i:
  139557: 8a2975d
  139555: 990b064
  139551: 579a652
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed Mar 28, 2009
1 parent 9ffffaf commit 5e7726a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1673d0de40ab46cac3b456ad50e1c8d6a31bfd66
refs/heads/master: d5a8620f7c8a5bcade730e2fa1224191f289fb00
35 changes: 14 additions & 21 deletions trunk/net/sunrpc/svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -896,38 +896,31 @@ int svc_register(const struct svc_serv *serv, const int family,
return error;
}

#ifdef CONFIG_SUNRPC_REGISTER_V4

/*
* If user space is running rpcbind, it should take the v4 UNSET
* and clear everything for this [program, version]. If user space
* is running portmap, it will reject the v4 UNSET, but won't have
* any "inet6" entries anyway. So a PMAP_UNSET should be sufficient
* in this case to clear all existing entries for [program, version].
*/
static void __svc_unregister(const u32 program, const u32 version,
const char *progname)
{
struct sockaddr_in6 sin6 = {
.sin6_family = AF_INET6,
.sin6_addr = IN6ADDR_ANY_INIT,
.sin6_port = 0,
};
int error;

error = rpcb_v4_register(program, version,
(struct sockaddr *)&sin6, "");
dprintk("svc: %s(%sv%u), error %d\n",
__func__, progname, version, error);
}

#else /* CONFIG_SUNRPC_REGISTER_V4 */
error = rpcb_v4_register(program, version, NULL, "");

static void __svc_unregister(const u32 program, const u32 version,
const char *progname)
{
int error;
/*
* User space didn't support rpcbind v4, so retry this
* request with the legacy rpcbind v2 protocol.
*/
if (error == -EPROTONOSUPPORT)
error = rpcb_register(program, version, 0, 0);

error = rpcb_register(program, version, 0, 0);
dprintk("svc: %s(%sv%u), error %d\n",
__func__, progname, version, error);
}

#endif /* CONFIG_SUNRPC_REGISTER_V4 */

/*
* All netids, bind addresses and ports registered for [program, version]
* are removed from the local rpcbind database (if the service is not
Expand Down

0 comments on commit 5e7726a

Please sign in to comment.