diff options
author | Jeff Layton <jlayton@redhat.com> | 2013-01-28 14:41:07 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2013-02-04 09:16:19 -0500 |
commit | 7b9e8522a65886d8ae168547a67c3617b6ba83f1 (patch) | |
tree | 285c0d08f3e967abb7e3c33e4846da353270183b /fs/nfsd/cache.h | |
parent | 885c91f74662404dc179b8775494df383479311c (diff) |
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>
Diffstat (limited to 'fs/nfsd/cache.h')
-rw-r--r-- | fs/nfsd/cache.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfsd/cache.h b/fs/nfsd/cache.h index 93cc9d34c459..2cac76c63b97 100644 --- a/fs/nfsd/cache.h +++ b/fs/nfsd/cache.h | |||
@@ -12,6 +12,10 @@ | |||
12 | 12 | ||
13 | /* | 13 | /* |
14 | * Representation of a reply cache entry. | 14 | * Representation of a reply cache entry. |
15 | * | ||
16 | * Note that we use a sockaddr_in6 to hold the address instead of the more | ||
17 | * typical sockaddr_storage. This is for space reasons, since sockaddr_storage | ||
18 | * is much larger than a sockaddr_in6. | ||
15 | */ | 19 | */ |
16 | struct svc_cacherep { | 20 | struct svc_cacherep { |
17 | struct hlist_node c_hash; | 21 | struct hlist_node c_hash; |
@@ -20,7 +24,7 @@ struct svc_cacherep { | |||
20 | unsigned char c_state, /* unused, inprog, done */ | 24 | unsigned char c_state, /* unused, inprog, done */ |
21 | c_type, /* status, buffer */ | 25 | c_type, /* status, buffer */ |
22 | c_secure : 1; /* req came from port < 1024 */ | 26 | c_secure : 1; /* req came from port < 1024 */ |
23 | struct sockaddr_in c_addr; | 27 | struct sockaddr_in6 c_addr; |
24 | __be32 c_xid; | 28 | __be32 c_xid; |
25 | u32 c_prot; | 29 | u32 c_prot; |
26 | u32 c_proc; | 30 | u32 c_proc; |