diff options
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 24ffc5e1d3da..ba46769c6e97 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -589,7 +589,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb) | |||
589 | #endif | 589 | #endif |
590 | arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr, | 590 | arg.csum = csum_tcpudp_nofold(ip_hdr(skb)->daddr, |
591 | ip_hdr(skb)->saddr, /* XXX */ | 591 | ip_hdr(skb)->saddr, /* XXX */ |
592 | sizeof(struct tcphdr), IPPROTO_TCP, 0); | 592 | arg.iov[0].iov_len, IPPROTO_TCP, 0); |
593 | arg.csumoffset = offsetof(struct tcphdr, check) / 2; | 593 | arg.csumoffset = offsetof(struct tcphdr, check) / 2; |
594 | arg.flags = (sk && inet_sk(sk)->transparent) ? IP_REPLY_ARG_NOSRCCHECK : 0; | 594 | arg.flags = (sk && inet_sk(sk)->transparent) ? IP_REPLY_ARG_NOSRCCHECK : 0; |
595 | 595 | ||
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) | |||
1012 | } | 1012 | } |
1013 | #endif | 1013 | #endif |
1014 | 1014 | ||
1015 | buff->csum = csum_partial((char *)t1, sizeof(*t1), 0); | 1015 | buff->csum = csum_partial((char *)t1, tot_len, 0); |
1016 | 1016 | ||
1017 | memset(&fl, 0, sizeof(fl)); | 1017 | memset(&fl, 0, sizeof(fl)); |
1018 | ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr); | 1018 | ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr); |
1019 | ipv6_addr_copy(&fl.fl6_src, &ipv6_hdr(skb)->daddr); | 1019 | ipv6_addr_copy(&fl.fl6_src, &ipv6_hdr(skb)->daddr); |
1020 | 1020 | ||
1021 | t1->check = csum_ipv6_magic(&fl.fl6_src, &fl.fl6_dst, | 1021 | t1->check = csum_ipv6_magic(&fl.fl6_src, &fl.fl6_dst, |
1022 | sizeof(*t1), IPPROTO_TCP, | 1022 | tot_len, IPPROTO_TCP, |
1023 | buff->csum); | 1023 | buff->csum); |
1024 | 1024 | ||
1025 | fl.proto = IPPROTO_TCP; | 1025 | fl.proto = IPPROTO_TCP; |