diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2012-08-26 12:58:41 -0400 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2012-08-26 12:58:41 -0400 |
commit | c78aa4c4b94b5b148be576a9f1570e31fe282b46 (patch) | |
tree | 6d5801eb3e60bcec6a91c7b13a334c6d2ea11b05 /net/ipv6/tcp_ipv6.c | |
parent | 90993cdd1800dc6ef9587431a0c625b978584e81 (diff) | |
parent | 9acb172543aecb783e2e1e53e3f447d4c0f5c150 (diff) |
Merge remote-tracking branch 'upstream/master' into queue
Merging critical fixes from upstream required for development.
* upstream/master: (809 commits)
libata: Add a space to " 2GB ATA Flash Disk" DMA blacklist entry
Revert "powerpc: Update g5_defconfig"
powerpc/perf: Use pmc_overflow() to detect rolled back events
powerpc: Fix VMX in interrupt check in POWER7 copy loops
powerpc: POWER7 copy_to_user/copy_from_user patch applied twice
powerpc: Fix personality handling in ppc64_personality()
powerpc/dma-iommu: Fix IOMMU window check
powerpc: Remove unnecessary ifdefs
powerpc/kgdb: Restore current_thread_info properly
powerpc/kgdb: Bail out of KGDB when we've been triggered
powerpc/kgdb: Do not set kgdb_single_step on ppc
powerpc/mpic_msgr: Add missing includes
powerpc: Fix null pointer deref in perf hardware breakpoints
powerpc: Fixup whitespace in xmon
powerpc: Fix xmon dl command for new printk implementation
xfs: check for possible overflow in xfs_ioc_trim
xfs: unlock the AGI buffer when looping in xfs_dialloc
xfs: fix uninitialised variable in xfs_rtbuf_get()
powerpc/fsl: fix "Failed to mount /dev: No such device" errors
powerpc/fsl: update defconfigs
...
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index c66b90f71c9b..a3e60cc04a8a 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -94,6 +94,18 @@ static struct tcp_md5sig_key *tcp_v6_md5_do_lookup(struct sock *sk, | |||
94 | } | 94 | } |
95 | #endif | 95 | #endif |
96 | 96 | ||
97 | static void inet6_sk_rx_dst_set(struct sock *sk, const struct sk_buff *skb) | ||
98 | { | ||
99 | struct dst_entry *dst = skb_dst(skb); | ||
100 | const struct rt6_info *rt = (const struct rt6_info *)dst; | ||
101 | |||
102 | dst_hold(dst); | ||
103 | sk->sk_rx_dst = dst; | ||
104 | inet_sk(sk)->rx_dst_ifindex = skb->skb_iif; | ||
105 | if (rt->rt6i_node) | ||
106 | inet6_sk(sk)->rx_dst_cookie = rt->rt6i_node->fn_sernum; | ||
107 | } | ||
108 | |||
97 | static void tcp_v6_hash(struct sock *sk) | 109 | static void tcp_v6_hash(struct sock *sk) |
98 | { | 110 | { |
99 | if (sk->sk_state != TCP_CLOSE) { | 111 | if (sk->sk_state != TCP_CLOSE) { |
@@ -1270,6 +1282,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1270 | 1282 | ||
1271 | newsk->sk_gso_type = SKB_GSO_TCPV6; | 1283 | newsk->sk_gso_type = SKB_GSO_TCPV6; |
1272 | __ip6_dst_store(newsk, dst, NULL, NULL); | 1284 | __ip6_dst_store(newsk, dst, NULL, NULL); |
1285 | inet6_sk_rx_dst_set(newsk, skb); | ||
1273 | 1286 | ||
1274 | newtcp6sk = (struct tcp6_sock *)newsk; | 1287 | newtcp6sk = (struct tcp6_sock *)newsk; |
1275 | inet_sk(newsk)->pinet6 = &newtcp6sk->inet6; | 1288 | inet_sk(newsk)->pinet6 = &newtcp6sk->inet6; |
@@ -1447,7 +1460,17 @@ static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb) | |||
1447 | opt_skb = skb_clone(skb, sk_gfp_atomic(sk, GFP_ATOMIC)); | 1460 | opt_skb = skb_clone(skb, sk_gfp_atomic(sk, GFP_ATOMIC)); |
1448 | 1461 | ||
1449 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ | 1462 | if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ |
1463 | struct dst_entry *dst = sk->sk_rx_dst; | ||
1464 | |||
1450 | sock_rps_save_rxhash(sk, skb); | 1465 | sock_rps_save_rxhash(sk, skb); |
1466 | if (dst) { | ||
1467 | if (inet_sk(sk)->rx_dst_ifindex != skb->skb_iif || | ||
1468 | dst->ops->check(dst, np->rx_dst_cookie) == NULL) { | ||
1469 | dst_release(dst); | ||
1470 | sk->sk_rx_dst = NULL; | ||
1471 | } | ||
1472 | } | ||
1473 | |||
1451 | if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) | 1474 | if (tcp_rcv_established(sk, skb, tcp_hdr(skb), skb->len)) |
1452 | goto reset; | 1475 | goto reset; |
1453 | if (opt_skb) | 1476 | if (opt_skb) |
@@ -1705,9 +1728,9 @@ static void tcp_v6_early_demux(struct sk_buff *skb) | |||
1705 | struct dst_entry *dst = sk->sk_rx_dst; | 1728 | struct dst_entry *dst = sk->sk_rx_dst; |
1706 | struct inet_sock *icsk = inet_sk(sk); | 1729 | struct inet_sock *icsk = inet_sk(sk); |
1707 | if (dst) | 1730 | if (dst) |
1708 | dst = dst_check(dst, 0); | 1731 | dst = dst_check(dst, inet6_sk(sk)->rx_dst_cookie); |
1709 | if (dst && | 1732 | if (dst && |
1710 | icsk->rx_dst_ifindex == inet6_iif(skb)) | 1733 | icsk->rx_dst_ifindex == skb->skb_iif) |
1711 | skb_dst_set_noref(skb, dst); | 1734 | skb_dst_set_noref(skb, dst); |
1712 | } | 1735 | } |
1713 | } | 1736 | } |
@@ -1723,6 +1746,7 @@ static const struct inet_connection_sock_af_ops ipv6_specific = { | |||
1723 | .queue_xmit = inet6_csk_xmit, | 1746 | .queue_xmit = inet6_csk_xmit, |
1724 | .send_check = tcp_v6_send_check, | 1747 | .send_check = tcp_v6_send_check, |
1725 | .rebuild_header = inet6_sk_rebuild_header, | 1748 | .rebuild_header = inet6_sk_rebuild_header, |
1749 | .sk_rx_dst_set = inet6_sk_rx_dst_set, | ||
1726 | .conn_request = tcp_v6_conn_request, | 1750 | .conn_request = tcp_v6_conn_request, |
1727 | .syn_recv_sock = tcp_v6_syn_recv_sock, | 1751 | .syn_recv_sock = tcp_v6_syn_recv_sock, |
1728 | .net_header_len = sizeof(struct ipv6hdr), | 1752 | .net_header_len = sizeof(struct ipv6hdr), |
@@ -1754,6 +1778,7 @@ static const struct inet_connection_sock_af_ops ipv6_mapped = { | |||
1754 | .queue_xmit = ip_queue_xmit, | 1778 | .queue_xmit = ip_queue_xmit, |
1755 | .send_check = tcp_v4_send_check, | 1779 | .send_check = tcp_v4_send_check, |
1756 | .rebuild_header = inet_sk_rebuild_header, | 1780 | .rebuild_header = inet_sk_rebuild_header, |
1781 | .sk_rx_dst_set = inet_sk_rx_dst_set, | ||
1757 | .conn_request = tcp_v6_conn_request, | 1782 | .conn_request = tcp_v6_conn_request, |
1758 | .syn_recv_sock = tcp_v6_syn_recv_sock, | 1783 | .syn_recv_sock = tcp_v6_syn_recv_sock, |
1759 | .net_header_len = sizeof(struct iphdr), | 1784 | .net_header_len = sizeof(struct iphdr), |