diff options
author | Denis V. Lunev <den@openvz.org> | 2008-04-03 17:19:38 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-04-03 17:19:38 -0400 |
commit | 14c0c8e8e0fb85e7a57e88606c009377746b39d9 (patch) | |
tree | 1ec620ca94f56974f03107ac95673b4df889f5a5 /net/ipv4/tcp_ipv4.c | |
parent | a4aa834a9165150252c5cd953faab4de29d51b87 (diff) |
[TCP]: Replace socket with sock for reset sending.
Replace tcp_socket with tcp_sock. This is more effective (less
derefferences on fast paths). Additionally, the approach is unified to
one used in ICMP.
Signed-off-by: Denis V. Lunev <den@openvz.org>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index ef141b841d2f..1d77f37d7708 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -89,7 +89,7 @@ int sysctl_tcp_low_latency __read_mostly; | |||
89 | #define ICMP_MIN_LENGTH 8 | 89 | #define ICMP_MIN_LENGTH 8 |
90 | 90 | ||
91 | /* Socket used for sending RSTs */ | 91 | /* Socket used for sending RSTs */ |
92 | static struct socket *tcp_socket __read_mostly; | 92 | static struct sock *tcp_sock __read_mostly; |
93 | 93 | ||
94 | void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb); | 94 | void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb); |
95 | 95 | ||
@@ -598,7 +598,7 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb) | |||
598 | sizeof(struct tcphdr), IPPROTO_TCP, 0); | 598 | sizeof(struct tcphdr), IPPROTO_TCP, 0); |
599 | arg.csumoffset = offsetof(struct tcphdr, check) / 2; | 599 | arg.csumoffset = offsetof(struct tcphdr, check) / 2; |
600 | 600 | ||
601 | ip_send_reply(tcp_socket->sk, skb, &arg, arg.iov[0].iov_len); | 601 | ip_send_reply(tcp_sock, skb, &arg, arg.iov[0].iov_len); |
602 | 602 | ||
603 | TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); | 603 | TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); |
604 | TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); | 604 | TCP_INC_STATS_BH(TCP_MIB_OUTRSTS); |
@@ -693,7 +693,7 @@ static void tcp_v4_send_ack(struct tcp_timewait_sock *twsk, | |||
693 | if (twsk) | 693 | if (twsk) |
694 | arg.bound_dev_if = twsk->tw_sk.tw_bound_dev_if; | 694 | arg.bound_dev_if = twsk->tw_sk.tw_bound_dev_if; |
695 | 695 | ||
696 | ip_send_reply(tcp_socket->sk, skb, &arg, arg.iov[0].iov_len); | 696 | ip_send_reply(tcp_sock, skb, &arg, arg.iov[0].iov_len); |
697 | 697 | ||
698 | TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); | 698 | TCP_INC_STATS_BH(TCP_MIB_OUTSEGS); |
699 | } | 699 | } |
@@ -2490,9 +2490,11 @@ struct proto tcp_prot = { | |||
2490 | 2490 | ||
2491 | void __init tcp_v4_init(void) | 2491 | void __init tcp_v4_init(void) |
2492 | { | 2492 | { |
2493 | if (inet_csk_ctl_sock_create(&tcp_socket, PF_INET, SOCK_RAW, | 2493 | struct socket *__tcp_socket; |
2494 | if (inet_csk_ctl_sock_create(&__tcp_socket, PF_INET, SOCK_RAW, | ||
2494 | IPPROTO_TCP) < 0) | 2495 | IPPROTO_TCP) < 0) |
2495 | panic("Failed to create the TCP control socket.\n"); | 2496 | panic("Failed to create the TCP control socket.\n"); |
2497 | tcp_sock = __tcp_socket->sk; | ||
2496 | } | 2498 | } |
2497 | 2499 | ||
2498 | EXPORT_SYMBOL(ipv4_specific); | 2500 | EXPORT_SYMBOL(ipv4_specific); |