diff options
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
| -rw-r--r-- | net/ipv4/tcp_ipv4.c | 20 | 
1 files changed, 20 insertions, 0 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index d57641cb3477..2ee45e3755e9 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -771,6 +771,8 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb)  	if (sk) {  		ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ?  				   inet_twsk(sk)->tw_mark : sk->sk_mark; +		ctl_sk->sk_priority = (sk->sk_state == TCP_TIME_WAIT) ? +				   inet_twsk(sk)->tw_priority : sk->sk_priority;  		transmit_time = tcp_transmit_time(sk);  	}  	ip_send_unicast_reply(ctl_sk, @@ -866,6 +868,8 @@ static void tcp_v4_send_ack(const struct sock *sk,  	ctl_sk = this_cpu_read(*net->ipv4.tcp_sk);  	ctl_sk->sk_mark = (sk->sk_state == TCP_TIME_WAIT) ?  			   inet_twsk(sk)->tw_mark : sk->sk_mark; +	ctl_sk->sk_priority = (sk->sk_state == TCP_TIME_WAIT) ? +			   inet_twsk(sk)->tw_priority : sk->sk_priority;  	transmit_time = tcp_transmit_time(sk);  	ip_send_unicast_reply(ctl_sk,  			      skb, &TCP_SKB_CB(skb)->header.h4.opt, @@ -1515,6 +1519,21 @@ static struct sock *tcp_v4_cookie_check(struct sock *sk, struct sk_buff *skb)  	return sk;  } +u16 tcp_v4_get_syncookie(struct sock *sk, struct iphdr *iph, +			 struct tcphdr *th, u32 *cookie) +{ +	u16 mss = 0; +#ifdef CONFIG_SYN_COOKIES +	mss = tcp_get_syncookie_mss(&tcp_request_sock_ops, +				    &tcp_request_sock_ipv4_ops, sk, th); +	if (mss) { +		*cookie = __cookie_v4_init_sequence(iph, th, &mss); +		tcp_synq_overflow(sk); +	} +#endif +	return mss; +} +  /* The socket must have it's spinlock held when we get   * here, unless it is a TCP_LISTEN socket.   * @@ -2637,6 +2656,7 @@ static int __net_init tcp_sk_init(struct net *net)  	net->ipv4.sysctl_tcp_min_snd_mss = TCP_MIN_SND_MSS;  	net->ipv4.sysctl_tcp_probe_threshold = TCP_PROBE_THRESHOLD;  	net->ipv4.sysctl_tcp_probe_interval = TCP_PROBE_INTERVAL; +	net->ipv4.sysctl_tcp_mtu_probe_floor = TCP_MIN_SND_MSS;  	net->ipv4.sysctl_tcp_keepalive_time = TCP_KEEPALIVE_TIME;  	net->ipv4.sysctl_tcp_keepalive_probes = TCP_KEEPALIVE_PROBES;  |