From: "Denis V. Lunev" <den@openvz.org>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, containers@lists.osdl.org,
"Denis V. Lunev" <den@openvz.org>
Subject: [PATCH 13/13 net-2.6.26] [NETNS]: Use TCP control socket from a correct namespace.
Date: Mon, 31 Mar 2008 17:16:53 +0400 [thread overview]
Message-ID: <1206969413-12096-13-git-send-email-den@openvz.org> (raw)
In-Reply-To: <1206969367.10660.16.camel@iris.sw.ru>
Signed-off-by: Denis V.Lunev <den@openvz.org>
---
net/ipv4/tcp_ipv4.c | 10 ++++------
1 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 1d4a77a..df89a56 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -88,9 +88,6 @@ int sysctl_tcp_low_latency __read_mostly;
/* Check TCP sequence numbers in ICMP packets. */
#define ICMP_MIN_LENGTH 8
-/* 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);
#ifdef CONFIG_TCP_MD5SIG
@@ -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);
TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
TCP_INC_STATS_BH(TCP_MIB_OUTRSTS);
@@ -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);
TCP_INC_STATS_BH(TCP_MIB_OUTSEGS);
}
@@ -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;
}
EXPORT_SYMBOL(ipv4_specific);
--
1.5.3.rc5
next prev parent reply other threads:[~2008-03-31 13:17 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-31 13:16 [PATCH 0/13 net-2.6.26] UDP/ICMP/TCP for a namespace v2 Denis V. Lunev
2008-03-31 13:16 ` [PATCH 1/13 net-2.6.26] [TCP]: Replace socket with sock for reset sending Denis V. Lunev
2008-03-31 13:44 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 2/13 net-2.6.26] [DCCP]: " Denis V. Lunev
2008-03-31 13:44 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 3/13 net-2.6.26] [DCCP]: dccp_v(4|6)_ctl_socket is leaked Denis V. Lunev
2008-03-31 13:46 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 4/13 net-2.6.26] [INET]: Rename inet_csk_ctl_sock_create to inet_ctl_sock_create Denis V. Lunev
2008-03-31 13:43 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 5/13 net-2.6.26] [SCTP]: Use inet_ctl_sock_create for control socket creation Denis V. Lunev
2008-03-31 13:46 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 6/13 net-2.6.26] [SCTP]: Replace socket with sock for SCTP control socket Denis V. Lunev
2008-03-31 13:47 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 7/13 net-2.6.26] [INET]: Let inet_ctl_sock_create return sock rather than socket Denis V. Lunev
2008-03-31 13:49 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 8/13 net-2.6.26] [NETNS]: Inet control socket should not hold a namespace Denis V. Lunev
2008-03-31 13:51 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 9/13 net-2.6.26] [ICMP]: Simplify ICMP control socket creation Denis V. Lunev
2008-03-31 13:51 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 10/13 net-2.6.26] [INET]: uc_ttl assignment in inet_ctl_sock_create is redundant Denis V. Lunev
2008-03-31 13:16 ` [PATCH 11/13 net-2.6.26] [IPV6]: Simplify IPv6 control sockets creation Denis V. Lunev
2008-03-31 13:52 ` Arnaldo Carvalho de Melo
2008-03-31 13:16 ` [PATCH 12/13 net-2.6.26] [NETNS]: Create tcp control socket in the each namespace Denis V. Lunev
2008-03-31 13:16 ` Denis V. Lunev [this message]
2008-04-03 21:58 ` [PATCH 0/13 net-2.6.26] UDP/ICMP/TCP for a namespace v2 David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1206969413-12096-13-git-send-email-den@openvz.org \
--to=den@openvz.org \
--cc=containers@lists.osdl.org \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).