linux/net/sunrpc
Chuck Lever 2c7eb0b206 SUNRPC: Register both netids for AF_INET6 servers
TI-RPC is a user-space library of RPC functions that replaces ONC RPC
and allows RPC to operate in the new world of IPv6.

TI-RPC combines the concept of a transport protocol (UDP and TCP)
and a protocol family (PF_INET and PF_INET6) into a single identifier
called a "netid."  For example, "udp" means UDP over IPv4, and "udp6"
means UDP over IPv6.

For rpcbind, then, the RPC service tuple that is registered and
advertised is:

  [RPC program, RPC version, service address and port, netid]

instead of

  [RPC program, RPC version, port, protocol]

Service address is typically ANYADDR, but can be a specific address
of one of the interfaces on a multi-homed host.  The third item in
the new tuple is expressed as a universal address.

The current Linux rpcbind implementation registers a netid for both
protocol families when RPCB_SET is done for just the PF_INET6 version
of the netid (ie udp6 or tcp6).  So registering "udp6" causes a
registration for "udp" to appear automatically as well.

We've recently determined that this is incorrect behavior.  In the
TI-RPC world, "udp6" is not meant to imply that the registered RPC
service handles requests from AF_INET as well, even if the listener
socket does address mapping.  "udp" and "udp6" are entirely separate
capabilities, and must be registered separately.

The Linux kernel, unlike TI-RPC, leverages address mapping to allow a
single listener socket to handle requests for both AF_INET and AF_INET6.
This is still OK, but the kernel currently assumes registering "udp6"
will cover "udp" as well.  It registers only "udp6" for it's AF_INET6
services, even though they handle both AF_INET and AF_INET6 on the same
port.

So svc_register() actually needs to register both "udp" and "udp6"
explicitly (and likewise for TCP).  Until rpcbind is fixed, the
kernel can ignore the return code for the second RPCB_SET call.

Please merge this with commit 15231312:

    SUNRPC: Support IPv6 when registering kernel RPC services

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: Olaf Kirch <okir@suse.de>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
2008-09-29 18:13:39 -04:00
..
auth_gss Merge branch 'for-2.6.27' of git://linux-nfs.org/~bfields/linux 2008-07-20 21:21:46 -07:00
xprtrdma svcrdma: Fix race between svc_rdma_recvfrom thread and the dto_tasklet 2008-08-13 16:57:31 -04:00
auth.c SUNRPC: Protect creds against early garbage collection 2008-04-19 16:55:02 -04:00
auth_generic.c SUNRPC: AUTH_SYS "machine creds" shouldn't use negative valued uid/gid 2008-05-18 14:18:27 -04:00
auth_null.c NFSv4: Don't use cred->cr_ops->cr_name in nfs4_proc_setclientid() 2008-04-19 16:54:53 -04:00
auth_unix.c SUNRPC: Use GFP_NOFS when allocating credentials 2008-07-09 12:08:48 -04:00
cache.c sunrpc: assign PDE->data before gluing PDE into /proc tree 2008-05-02 02:44:36 -07:00
clnt.c SUNRPC: Ensure our task is notified when an rpcbind call is done 2008-07-09 12:09:45 -04:00
Makefile SUNRPC: Add a generic RPC credential 2008-03-14 13:42:38 -04:00
rpc_pipe.c SL*B: drop kmem cache argument from constructor 2008-07-26 12:00:07 -07:00
rpcb_clnt.c SUNRPC: Simplify rpcb_register() API 2008-09-29 18:13:37 -04:00
sched.c SUNRPC: Remove the BKL from the callback functions 2008-07-15 18:10:57 -04:00
socklib.c SUNRPC: temp var should match return type of xdr_skb_read_actor 2008-01-30 02:05:43 -05:00
stats.c sunrpc: assign PDE->data before gluing PDE into /proc tree 2008-05-02 02:44:36 -07:00
sunrpc_syms.c SUNRPC: Move exported symbol definitions after function declaration part 2 2008-02-01 17:01:24 -05:00
svc.c SUNRPC: Register both netids for AF_INET6 servers 2008-09-29 18:13:39 -04:00
svc_xprt.c SUNRPC: Use proper INADDR_ANY when setting up RPC services on IPv6 2008-09-29 17:56:56 -04:00
svcauth.c SUNRPC: Move exported symbol definitions after function declaration part 2 2008-02-01 17:01:24 -05:00
svcauth_unix.c svcrpc: fix proc/net/rpc/auth.unix.ip/content display 2008-05-18 19:13:07 -04:00
svcsock.c SUNRPC: Set V6ONLY socket option for RPC listener sockets 2008-09-29 18:13:37 -04:00
sysctl.c sunrpc: fix possible overrun on read of /proc/sys/sunrpc/transports 2008-09-01 14:24:24 -04:00
timer.c SUNRPC: add EXPORT_SYMBOL_GPL for generic transport functions 2007-10-09 17:17:36 -04:00
xdr.c SUNRPC: don't call flush_dcache_page() with an invalid pointer 2008-04-08 21:06:50 -04:00
xprt.c SUNRPC: Ensure all transports set rq_xtime consistently 2008-07-09 12:09:15 -04:00
xprtsock.c SUNRPC: Ensure all transports set rq_xtime consistently 2008-07-09 12:09:15 -04:00