Commit 7feb49c8 authored by Denis V. Lunev's avatar Denis V. Lunev Committed by David S. Miller
Browse files

[NETNS]: Use TCP control socket from a correct namespace.

Signed-off-by: default avatarDenis V.Lunev <>
Signed-off-by: default avatarDavid S. Miller <>
parent 046ee902
......@@ -88,9 +88,6 @@ int sysctl_tcp_low_latency __read_mostly;
/* Check TCP sequence numbers in ICMP packets. */
/* Socket used for sending RSTs */
static struct sock *tcp_sock __read_mostly;
void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb);
......@@ -598,7 +595,8 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
sizeof(struct tcphdr), IPPROTO_TCP, 0);
arg.csumoffset = offsetof(struct tcphdr, check) / 2;
ip_send_reply(tcp_sock, skb, &arg, arg.iov[0].iov_len);
ip_send_reply(dev_net(skb->dst->dev)->ipv4.tcp_sock, skb,
&arg, arg.iov[0].iov_len);
......@@ -693,7 +691,8 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk,
if (twsk)
arg.bound_dev_if = twsk->tw_sk.tw_bound_dev_if;
ip_send_reply(tcp_sock, skb, &arg, arg.iov[0].iov_len);
ip_send_reply(dev_net(skb->dev)->ipv4.tcp_sock, skb,
&arg, arg.iov[0].iov_len);
......@@ -2509,7 +2508,6 @@ void __init tcp_v4_init(void)
if (register_pernet_device(&tcp_sk_ops))
panic("Failed to create the TCP control socket.\n");
tcp_sock = init_net.ipv4.tcp_sock;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment