Skip to content
  • Chuck Lever's avatar
    SUNRPC: Set V6ONLY socket option for RPC listener sockets · b6632339
    Chuck Lever authored
    
    
    My plan is to use an AF_INET listener on systems that support only IPv4,
    and an AF_INET6 listener on systems that can support IPv6. Incoming
    IPv4 packets will be posted to an AF_INET6 listener with a mapped IPv4
    address.
    
    Max Matveev <makc@sgi.com> says:
      Creating a single listener can be dangerous - if net.ipv6.bindv6only
      is enabled then it's possible to create another listener in v4
      namespace on the same port and steal the traffic from the "unifed"
      listener. You need to disable V6ONLY explicitly via a sockopt to stop
      that.
    
    Set appropriate socket option on RPC server listener sockets to prevent
    this.
    
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
    b6632339