nfsd: fix IPv6 address handling in the DRC
Currently, it only stores the first 16 bytes of any address. struct sockaddr_in6 is 28 bytes however, so we're currently ignoring the last 12 bytes of the address. Expand the c_addr field to a sockaddr_in6, and cast it to a sockaddr_in as necessary. Also fix the comparitor to use the existing RPC helpers for this. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:

committed by
J. Bruce Fields

parent
885c91f746
commit
7b9e8522a6
@@ -263,7 +263,9 @@ static inline bool __rpc_copy_addr6(struct sockaddr *dst,
|
||||
* @sap1: first sockaddr
|
||||
* @sap2: second sockaddr
|
||||
*
|
||||
* Just compares the family and address portion. Ignores port, scope, etc.
|
||||
* Just compares the family and address portion. Ignores port, but
|
||||
* compares the scope if it's a link-local address.
|
||||
*
|
||||
* Returns true if the addrs are equal, false if they aren't.
|
||||
*/
|
||||
static inline bool rpc_cmp_addr(const struct sockaddr *sap1,
|
||||
|
Reference in New Issue
Block a user