]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Don't flag empty RPCB_GETADDR reply as bogus
authorChuck Lever <chuck.lever@oracle.com>
Thu, 19 Mar 2009 00:45:28 +0000 (20:45 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 28 Mar 2009 19:52:08 +0000 (15:52 -0400)
commit1cc259535e06d768e0ca4a055cedc22a3e3dbcf0
treebf99838d1e073b8caee80bd79027d69892585d5c
parent5e36603942741e633fdd6606991875f416d72f4e
SUNRPC: Don't flag empty RPCB_GETADDR reply as bogus

In 2007, commit 19556396525730be7a5c79e52fdbe12829413d49 added
additional sanity checking to rpcb_decode_getaddr() to make sure we
were getting a reply that was long enough to be an actual universal
address.  If the uaddr string isn't long enough, the XDR decoder
returns EIO.

However, an empty string is a valid RPCB_GETADDR response if the
requested service isn't registered.  Moreover, "::.n.m" is also a
valid RPCB_GETADDR response for IPv6 addresses that is shorter
than rpcb_decode_getaddr()'s lower limit of 11.  So this sanity
check introduced a regression for rpcbind requests against IPv6
remotes.

So revert the lower bound check added by commit
19556396525730be7a5c79e52fdbe12829413d49, and add an explicit check
for an empty uaddr string, similar to libtirpc's rpcb_getaddr(3).

Pointed-out-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
net/sunrpc/rpcb_clnt.c