diff options
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 10e22fd48222..dd7bdde7bddc 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -330,7 +330,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
330 | th->dest, &hdr->saddr, th->source, skb->dev->ifindex); | 330 | th->dest, &hdr->saddr, th->source, skb->dev->ifindex); |
331 | 331 | ||
332 | if (sk == NULL) { | 332 | if (sk == NULL) { |
333 | ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS); | 333 | ICMP6_INC_STATS_BH(net, __in6_dev_get(skb->dev), |
334 | ICMP6_MIB_INERRORS); | ||
334 | return; | 335 | return; |
335 | } | 336 | } |
336 | 337 | ||
@@ -1011,14 +1012,14 @@ static void tcp_v6_send_reset(struct sock *sk, struct sk_buff *skb) | |||
1011 | } | 1012 | } |
1012 | #endif | 1013 | #endif |
1013 | 1014 | ||
1014 | buff->csum = csum_partial((char *)t1, sizeof(*t1), 0); | 1015 | buff->csum = csum_partial((char *)t1, tot_len, 0); |
1015 | 1016 | ||
1016 | memset(&fl, 0, sizeof(fl)); | 1017 | memset(&fl, 0, sizeof(fl)); |
1017 | ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr); | 1018 | ipv6_addr_copy(&fl.fl6_dst, &ipv6_hdr(skb)->saddr); |
1018 | ipv6_addr_copy(&fl.fl6_src, &ipv6_hdr(skb)->daddr); | 1019 | ipv6_addr_copy(&fl.fl6_src, &ipv6_hdr(skb)->daddr); |
1019 | 1020 | ||
1020 | t1->check = csum_ipv6_magic(&fl.fl6_src, &fl.fl6_dst, | 1021 | t1->check = csum_ipv6_magic(&fl.fl6_src, &fl.fl6_dst, |
1021 | sizeof(*t1), IPPROTO_TCP, | 1022 | tot_len, IPPROTO_TCP, |
1022 | buff->csum); | 1023 | buff->csum); |
1023 | 1024 | ||
1024 | fl.proto = IPPROTO_TCP; | 1025 | fl.proto = IPPROTO_TCP; |
@@ -1087,7 +1088,7 @@ static void tcp_v6_send_ack(struct sk_buff *skb, u32 seq, u32 ack, u32 win, u32 | |||
1087 | *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | | 1088 | *topt++ = htonl((TCPOPT_NOP << 24) | (TCPOPT_NOP << 16) | |
1088 | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP); | 1089 | (TCPOPT_TIMESTAMP << 8) | TCPOLEN_TIMESTAMP); |
1089 | *topt++ = htonl(tcp_time_stamp); | 1090 | *topt++ = htonl(tcp_time_stamp); |
1090 | *topt = htonl(ts); | 1091 | *topt++ = htonl(ts); |
1091 | } | 1092 | } |
1092 | 1093 | ||
1093 | #ifdef CONFIG_TCP_MD5SIG | 1094 | #ifdef CONFIG_TCP_MD5SIG |
@@ -1286,7 +1287,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1286 | struct request_sock *req, | 1287 | struct request_sock *req, |
1287 | struct dst_entry *dst) | 1288 | struct dst_entry *dst) |
1288 | { | 1289 | { |
1289 | struct inet6_request_sock *treq = inet6_rsk(req); | 1290 | struct inet6_request_sock *treq; |
1290 | struct ipv6_pinfo *newnp, *np = inet6_sk(sk); | 1291 | struct ipv6_pinfo *newnp, *np = inet6_sk(sk); |
1291 | struct tcp6_sock *newtcp6sk; | 1292 | struct tcp6_sock *newtcp6sk; |
1292 | struct inet_sock *newinet; | 1293 | struct inet_sock *newinet; |
@@ -1350,6 +1351,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1350 | return newsk; | 1351 | return newsk; |
1351 | } | 1352 | } |
1352 | 1353 | ||
1354 | treq = inet6_rsk(req); | ||
1353 | opt = np->opt; | 1355 | opt = np->opt; |
1354 | 1356 | ||
1355 | if (sk_acceptq_is_full(sk)) | 1357 | if (sk_acceptq_is_full(sk)) |
@@ -1680,11 +1682,7 @@ static int tcp_v6_rcv(struct sk_buff *skb) | |||
1680 | TCP_SKB_CB(skb)->flags = ipv6_get_dsfield(ipv6_hdr(skb)); | 1682 | TCP_SKB_CB(skb)->flags = ipv6_get_dsfield(ipv6_hdr(skb)); |
1681 | TCP_SKB_CB(skb)->sacked = 0; | 1683 | TCP_SKB_CB(skb)->sacked = 0; |
1682 | 1684 | ||
1683 | sk = __inet6_lookup(net, &tcp_hashinfo, | 1685 | sk = __inet6_lookup_skb(&tcp_hashinfo, skb, th->source, th->dest); |
1684 | &ipv6_hdr(skb)->saddr, th->source, | ||
1685 | &ipv6_hdr(skb)->daddr, ntohs(th->dest), | ||
1686 | inet6_iif(skb)); | ||
1687 | |||
1688 | if (!sk) | 1686 | if (!sk) |
1689 | goto no_tcp_socket; | 1687 | goto no_tcp_socket; |
1690 | 1688 | ||