aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-02-07 16:29:30 -0500
committerDavid S. Miller <davem@davemloft.net>2017-02-07 16:29:30 -0500
commit3efa70d78f218e4c9276b0bac0545e5184c1c47b (patch)
treef4abe2f05e173023d2a262afd4aebb1e89fe6985 /net/ipv6/tcp_ipv6.c
parent76e0e70e6452b971a69cc9794ff4a6715c11f7f2 (diff)
parent926af6273fc683cd98cd0ce7bf0d04a02eed6742 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
The conflict was an interaction between a bug fix in the netvsc driver in 'net' and an optimization of the RX path in 'net-next'. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 6b9fc63fd4d2..b5d27212db2f 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -996,6 +996,16 @@ drop:
996 return 0; /* don't send reset */ 996 return 0; /* don't send reset */
997} 997}
998 998
999static void tcp_v6_restore_cb(struct sk_buff *skb)
1000{
1001 /* We need to move header back to the beginning if xfrm6_policy_check()
1002 * and tcp_v6_fill_cb() are going to be called again.
1003 * ip6_datagram_recv_specific_ctl() also expects IP6CB to be there.
1004 */
1005 memmove(IP6CB(skb), &TCP_SKB_CB(skb)->header.h6,
1006 sizeof(struct inet6_skb_parm));
1007}
1008
999static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *skb, 1009static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
1000 struct request_sock *req, 1010 struct request_sock *req,
1001 struct dst_entry *dst, 1011 struct dst_entry *dst,
@@ -1184,8 +1194,10 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *
1184 sk_gfp_mask(sk, GFP_ATOMIC)); 1194 sk_gfp_mask(sk, GFP_ATOMIC));
1185 consume_skb(ireq->pktopts); 1195 consume_skb(ireq->pktopts);
1186 ireq->pktopts = NULL; 1196 ireq->pktopts = NULL;
1187 if (newnp->pktoptions) 1197 if (newnp->pktoptions) {
1198 tcp_v6_restore_cb(newnp->pktoptions);
1188 skb_set_owner_r(newnp->pktoptions, newsk); 1199 skb_set_owner_r(newnp->pktoptions, newsk);
1200 }
1189 } 1201 }
1190 } 1202 }
1191 1203
@@ -1200,16 +1212,6 @@ out:
1200 return NULL; 1212 return NULL;
1201} 1213}
1202 1214
1203static void tcp_v6_restore_cb(struct sk_buff *skb)
1204{
1205 /* We need to move header back to the beginning if xfrm6_policy_check()
1206 * and tcp_v6_fill_cb() are going to be called again.
1207 * ip6_datagram_recv_specific_ctl() also expects IP6CB to be there.
1208 */
1209 memmove(IP6CB(skb), &TCP_SKB_CB(skb)->header.h6,
1210 sizeof(struct inet6_skb_parm));
1211}
1212
1213/* The socket must have it's spinlock held when we get 1215/* The socket must have it's spinlock held when we get
1214 * here, unless it is a TCP_LISTEN socket. 1216 * here, unless it is a TCP_LISTEN socket.
1215 * 1217 *