diff options
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
| -rw-r--r-- | net/ipv6/tcp_ipv6.c | 14 | 
1 files changed, 6 insertions, 8 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 11b736a76bd7..1bf93b61aa06 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -272,6 +272,7 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr,  	fl6.flowi6_proto = IPPROTO_TCP;  	fl6.daddr = sk->sk_v6_daddr;  	fl6.saddr = saddr ? *saddr : np->saddr; +	fl6.flowlabel = ip6_make_flowinfo(np->tclass, np->flow_label);  	fl6.flowi6_oif = sk->sk_bound_dev_if;  	fl6.flowi6_mark = sk->sk_mark;  	fl6.fl6_dport = usin->sin6_port; @@ -1387,14 +1388,11 @@ static struct sock *tcp_v6_syn_recv_sock(const struct sock *sk, struct sk_buff *  		/* Clone pktoptions received with SYN, if we own the req */  		if (ireq->pktopts) { -			newnp->pktoptions = skb_clone(ireq->pktopts, -						      sk_gfp_mask(sk, GFP_ATOMIC)); +			newnp->pktoptions = skb_clone_and_charge_r(ireq->pktopts, newsk);  			consume_skb(ireq->pktopts);  			ireq->pktopts = NULL; -			if (newnp->pktoptions) { +			if (newnp->pktoptions)  				tcp_v6_restore_cb(newnp->pktoptions); -				skb_set_owner_r(newnp->pktoptions, newsk); -			}  		}  	} else {  		if (!req_unhash && found_dup_sk) { @@ -1466,7 +1464,7 @@ int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)  					       --ANK (980728)  	 */  	if (np->rxopt.all) -		opt_skb = skb_clone(skb, sk_gfp_mask(sk, GFP_ATOMIC)); +		opt_skb = skb_clone_and_charge_r(skb, sk);  	reason = SKB_DROP_REASON_NOT_SPECIFIED;  	if (sk->sk_state == TCP_ESTABLISHED) { /* Fast path */ @@ -1552,7 +1550,6 @@ ipv6_pktoptions:  		if (np->repflow)  			np->flow_label = ip6_flowlabel(ipv6_hdr(opt_skb));  		if (ipv6_opt_accepted(sk, opt_skb, &TCP_SKB_CB(opt_skb)->header.h6)) { -			skb_set_owner_r(opt_skb, sk);  			tcp_v6_restore_cb(opt_skb);  			opt_skb = xchg(&np->pktoptions, opt_skb);  		} else { @@ -1708,8 +1705,9 @@ process:  	if (static_branch_unlikely(&ip6_min_hopcount)) {  		/* min_hopcount can be changed concurrently from do_ipv6_setsockopt() */ -		if (hdr->hop_limit < READ_ONCE(tcp_inet6_sk(sk)->min_hopcount)) { +		if (unlikely(hdr->hop_limit < READ_ONCE(tcp_inet6_sk(sk)->min_hopcount))) {  			__NET_INC_STATS(net, LINUX_MIB_TCPMINTTLDROP); +			drop_reason = SKB_DROP_REASON_TCP_MINTTL;  			goto discard_and_relse;  		}  	}  |