1. 10 8月, 2009 9 次提交
    • C
      SUNRPC: Use rpc_ntop() for constructing transport address strings · c877b849
      Chuck Lever 提交于
      Clean up:  In addition to using the new generic rpc_ntop() and
      rpc_get_port() functions, have the RPC client compute the presentation
      address buffer sizes dynamically using kstrdup().
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      c877b849
    • C
      SUNRPC: Remove duplicate universal address generation · ba809130
      Chuck Lever 提交于
      RPC universal address generation is currently done in several places:
      rpcb_clnt.c, nfs4proc.c xprtsock.c, and xprtrdma.c.  Remove the
      redundant cases that convert a socket address to a universal
      address.  The nfs4proc.c case takes a pre-formatted presentation
      address string, not a socket address, so we'll leave that one.
      
      Because the new uaddr constructor uses the recently introduced
      rpc_ntop(), it now supports proper "::" shorthanding for IPv6
      addresses.  This allows the kernel to register properly formed
      universal addresses with the local rpcbind service, in _all_ cases.
      
      The kernel can now also send properly formed universal addresses in
      RPCB_GETADDR requests, and support link-local properly when
      encoding and decoding IPv6 addresses.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ba809130
    • C
      SUNRPC: Provide functions for managing universal addresses · a02d6926
      Chuck Lever 提交于
      Introduce a set of functions in the kernel's RPC implementation for
      converting between a socket address and either a standard
      presentation address string or an RPC universal address.
      
      The universal address functions will be used to encode and decode
      RPCB_FOO and NFSv4 SETCLIENTID arguments.  The other functions are
      part of a previous promise to deliver shared functions that can be
      used by upper-layer protocols to display and manipulate IP
      addresses.
      
      The kernel's current address printf formatters were designed
      specifically for kernel to user-space APIs that require a particular
      string format for socket addresses, thus are somewhat limited for the
      purposes of sunrpc.ko.  The formatter for IPv6 addresses, %pI6, does
      not support short-handing or scope IDs.  Also, these printf formatters
      are unique per address family, so a separate formatter string is
      required for printing AF_INET and AF_INET6 addresses.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      a02d6926
    • C
      SUNRPC: Move XDR data type size macros · 0b10bf5e
      Chuck Lever 提交于
      Clean up: To make subsequent patches cleaner, move the XDR data type
      size macros to the top of the file (similar to nfs4xdr.c) first.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      0b10bf5e
    • C
      SUNRPC: Clean up RPCBIND_MAXUADDRLEN definitions · 169026a6
      Chuck Lever 提交于
      Clean up: Replace the single-integer definition of RPCBIND_MAXUADDRLEN
      with a definition that is based on previously defined address string
      sizes, and document the way this maximum is calculated.  Also provide
      a separate macro for the size of the port number extension.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      169026a6
    • C
      NFS: Use the authentication flavor list returned by mountd · ec88f28d
      Chuck Lever 提交于
      Commit a14017db added support in the kernel's NFS mount client to
      decode the authentication flavor list returned by mountd.
      
      The NFS client can now use this list to determine whether the
      authentication flavor requested by the user is actually supported
      by the server.
      
      Note we don't actually negotiate the security flavor if none was
      specified by the user.  Instead, we try to use AUTH_SYS, and fail if
      the server does not support it.  This prevents us from negotiating
      an inappropriate security flavor (some servers list AUTH_NULL first).
      
      If the server does not support AUTH_SYS, the user must provide an
      appropriate security flavor by specifying the "sec=" mount option.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      ec88f28d
    • C
      NFS: Fix auth flavor len accounting · 059f90b3
      Chuck Lever 提交于
      Previous logic in the NFS mount parsing code path assumed
      auth_flavor_len was set to zero for simple authentication flavors
      (like AUTH_UNIX), and 1 for compound flavors (like AUTH_GSS).
      
      At some earlier point (maybe even before the option parsers were
      merged?) specific checks for auth_flavor_len being zero were removed
      from the functions that validate the mount option that sets the mount
      point's authentication flavor.
      
      Since we are populating an array for authentication flavors, the
      auth_flavor_len should always be set to the number of flavors.  Let's
      eliminate some cleverness here, and prepare for new logic that needs
      to know the number of flavors in the auth_flavors[] array.
      
      (auth_flavors[] is an array because at some point we want to allow a
      list of acceptable authentication flavors to be specified via the sec=
      mount option.  For now it remains a single element array).
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      059f90b3
    • C
      NFS: Add ability to send MOUNTPROC_UMNT to the kernel's mountd client · 0b524123
      Chuck Lever 提交于
      After certain failure modes of an NFS mount, an NFS client should send
      a MOUNTPROC_UMNT request to remove the just-added mount entry from the
      server's mount table.  While no-one should rely on the accuracy of the
      server's mount table, sending a UMNT is simply being a good internet
      neighbor.
      
      Since NFS mount processing is handled in the kernel now, we will need
      a function in the kernel's mountd client that can post a MOUNTRPC_UMNT
      request, in order to handle these failure modes.
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      0b524123
    • C
      NFS: Fix up new minorversion= option · f3f4f4ed
      Chuck Lever 提交于
      The new minorversion= mount option (commit 3fd5be9e) was merged at
      the same time as the recent sloppy parser fixes (commit a5a16bae),
      so minorversion= still uses the old value parsing logic.
      
      If the minorversion= option specifies a bogus value, it should fail
      with "bad value" not "bad option."
      Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
      Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
      f3f4f4ed
  2. 08 8月, 2009 31 次提交