aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorIlpo Järvinen <[email protected]>2008-10-08 18:34:06 +0000
committerDavid S. Miller <[email protected]>2008-10-08 18:34:06 +0000
commit52cd5750e81ec8d213949fa7c0d2e08907bf498b (patch)
tree10e7a8127022e99bf6e729fe04420fa82a0997a8 /net/ipv6/tcp_ipv6.c
parentipv6: remove unused not init_ipv6_mibs/cleanup_ipv6_mibs (diff)
downloadkernel-52cd5750e81ec8d213949fa7c0d2e08907bf498b.tar.gz
kernel-52cd5750e81ec8d213949fa7c0d2e08907bf498b.zip
tcp: fix length used for checksum in a reset
While looking for some common code I came across difference in checksum calculation between tcp_v6_send_(reset|ack) I couldn't explain. I checked both v4 and v6 and found out that both seem to have the same "feature". I couldn't find anything in rfc nor anywhere else which would state that md5 option should be ignored like it was in case of reset so I came to a conclusion that this is probably a genuine bug. I suspect that addition of md5 just was fooled by the excessive copy-paste code in those functions and the reset part was never tested well enough to find out the problem. Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 424d9c4a67ac..e8b0fdd9edb8 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -1012,14 +1012,14 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb)
}
#endif
- buff->csum = csum_partial((char *)t1, sizeof(*t1), 0);
+ buff->csum = csum_partial((char *)t1, tot_len, 0);
memset(&fl, 0, sizeof(fl));
ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr);
ipv6_addr_copy(&fl.fl6_src, &ipv6_hdr(skb)->daddr);
t1->check = csum_ipv6_magic(&fl.fl6_src, &fl.fl6_dst,
- sizeof(*t1), IPPROTO_TCP,
+ tot_len, IPPROTO_TCP,
buff->csum);
fl.proto = IPPROTO_TCP;