aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/tcp_ipv4.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 1d4a77acdc0b..df89a566a5a1 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -88,9 +88,6 @@ int sysctl_tcp_low_latency __read_mostly;
88/* Check TCP sequence numbers in ICMP packets. */ 88/* Check TCP sequence numbers in ICMP packets. */
89#define ICMP_MIN_LENGTH 8 89#define ICMP_MIN_LENGTH 8
90 90
91/* Socket used for sending RSTs */
92static struct sock *tcp_sock __read_mostly;
93
94void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb); 91void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb);
95 92
96#ifdef CONFIG_TCP_MD5SIG 93#ifdef CONFIG_TCP_MD5SIG
@@ -598,7 +595,8 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
598 sizeof(struct tcphdr), IPPROTO_TCP, 0); 595 sizeof(struct tcphdr), IPPROTO_TCP, 0);
599 arg.csumoffset = offsetof(struct tcphdr, check) / 2; 596 arg.csumoffset = offsetof(struct tcphdr, check) / 2;
600 597
601 ip_send_reply(tcp_sock, skb, &arg, arg.iov[0].iov_len); 598 ip_send_reply(dev_net(skb->dst->dev)->ipv4.tcp_sock, skb,
599 &arg, arg.iov[0].iov_len);
602 600
603 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); 601 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
604 TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); 602 TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
@@ -693,7 +691,8 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk,
693 if (twsk) 691 if (twsk)
694 arg.bound_dev_if = twsk->tw_sk.tw_bound_dev_if; 692 arg.bound_dev_if = twsk->tw_sk.tw_bound_dev_if;
695 693
696 ip_send_reply(tcp_sock, skb, &arg, arg.iov[0].iov_len); 694 ip_send_reply(dev_net(skb->dev)->ipv4.tcp_sock, skb,
695 &arg, arg.iov[0].iov_len);
697 696
698 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); 697 TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
699} 698}
@@ -2509,7 +2508,6 @@ void __init tcp_v4_init(void)
2509{ 2508{
2510 if (register_pernet_device(&tcp_sk_ops)) 2509 if (register_pernet_device(&tcp_sk_ops))
2511 panic("Failed to create the TCP control socket.\n"); 2510 panic("Failed to create the TCP control socket.\n");
2512 tcp_sock = init_net.ipv4.tcp_sock;
2513} 2511}
2514 2512
2515EXPORT_SYMBOL(ipv4_specific); 2513EXPORT_SYMBOL(ipv4_specific);