diff options
author | David S. Miller <davem@davemloft.net> | 2012-06-09 14:56:12 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-09 14:56:12 -0700 |
commit | 2397849baa7c44c242e5d5142d5d16d1e7ed53d0 (patch) | |
tree | 0ee2012361d1b0f8a92b68da7d0d92209613ecaf /net/ipv6 | |
parent | 4670fd819e7f47392c7c6fc6168ea2857c66d163 (diff) | |
download | talos-obmc-linux-2397849baa7c44c242e5d5142d5d16d1e7ed53d0.tar.gz talos-obmc-linux-2397849baa7c44c242e5d5142d5d16d1e7ed53d0.zip |
[PATCH] tcp: Cache inetpeer in timewait socket, and only when necessary.
Since it's guarenteed that we will access the inetpeer if we're trying
to do timewait recycling and TCP options were enabled on the
connection, just cache the peer in the timewait socket.
In the future, inetpeer lookups will be context dependent (per routing
realm), and this helps facilitate that as well.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index b5ecf37b61a6..f91b0bfd12d5 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1746,23 +1746,10 @@ static struct inet_peer *tcp_v6_get_peer(struct sock *sk) return rt6_get_peer_create(rt); } -static void *tcp_v6_tw_get_peer(struct sock *sk) -{ - const struct inet6_timewait_sock *tw6 = inet6_twsk(sk); - const struct inet_timewait_sock *tw = inet_twsk(sk); - struct net *net = sock_net(sk); - - if (tw->tw_family == AF_INET) - return tcp_v4_tw_get_peer(sk); - - return inet_getpeer_v6(net, &tw6->tw_v6_daddr, 1); -} - static struct timewait_sock_ops tcp6_timewait_sock_ops = { .twsk_obj_size = sizeof(struct tcp6_timewait_sock), .twsk_unique = tcp_twsk_unique, .twsk_destructor= tcp_twsk_destructor, - .twsk_getpeer = tcp_v6_tw_get_peer, }; static const struct inet_connection_sock_af_ops ipv6_specific = { |