diff options
author | David S. Miller <davem@sunset.davemloft.net> | 2007-09-28 18:18:35 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-09-28 18:18:35 -0400 |
commit | f8ab18d2d987a59ccbf0495032b2aef05b730037 (patch) | |
tree | 7a24c79632c91e22235888875813950c6c30d929 /include/net/tcp.h | |
parent | e79ad711a0108475c1b3a03815527e7237020b08 (diff) |
[TCP]: Fix MD5 signature handling on big-endian.
Based upon a report and initial patch by Peter Lieven.
tcp4_md5sig_key and tcp6_md5sig_key need to start with
the exact same members as tcp_md5sig_key. Because they
are both cast to that type by tcp_v{4,6}_md5_do_lookup().
Unfortunately tcp{4,6}_md5sig_key use a u16 for the key
length instead of a u8, which is what tcp_md5sig_key
uses. This just so happens to work by accident on
little-endian, but on big-endian it doesn't.
Instead of casting, just place tcp_md5sig_key as the first member of
the address-family specific structures, adjust the access sites, and
kill off the ugly casts.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index 185c7ecce4cc..54053de0bdd7 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -1059,14 +1059,12 @@ struct tcp_md5sig_key { | |||
1059 | }; | 1059 | }; |
1060 | 1060 | ||
1061 | struct tcp4_md5sig_key { | 1061 | struct tcp4_md5sig_key { |
1062 | u8 *key; | 1062 | struct tcp_md5sig_key base; |
1063 | u16 keylen; | ||
1064 | __be32 addr; | 1063 | __be32 addr; |
1065 | }; | 1064 | }; |
1066 | 1065 | ||
1067 | struct tcp6_md5sig_key { | 1066 | struct tcp6_md5sig_key { |
1068 | u8 *key; | 1067 | struct tcp_md5sig_key base; |
1069 | u16 keylen; | ||
1070 | #if 0 | 1068 | #if 0 |
1071 | u32 scope_id; /* XXX */ | 1069 | u32 scope_id; /* XXX */ |
1072 | #endif | 1070 | #endif |