aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-06-19 01:47:59 -0400
committerDavid S. Miller <davem@davemloft.net>2005-06-19 01:47:59 -0400
commit0e87506fcc734647c7b2497eee4eb81e785c857a (patch)
treebb8863c59fdef2628f17b6773c52801792a57722 /net/ipv6
parent60236fdd08b2169045a3bbfc5ffe1576e6c3c17b (diff)
[NET] Generalise tcp_listen_opt
This chunks out the accept_queue and tcp_listen_opt code and moves them to net/core/request_sock.c and include/net/request_sock.h, to make it useful for other transport protocols, DCCP being the first one to use it. Next patches will rename tcp_listen_opt to accept_sock and remove the inline tcp functions that just call a reqsk_queue_ function. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/tcp_ipv6.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 068cd4a8c29..84091daad6b 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -401,7 +401,7 @@ static struct request_sock *tcp_v6_search_req(struct tcp_sock *tp,
401 struct in6_addr *laddr, 401 struct in6_addr *laddr,
402 int iif) 402 int iif)
403{ 403{
404 struct tcp_listen_opt *lopt = tp->listen_opt; 404 struct tcp_listen_opt *lopt = tp->accept_queue.listen_opt;
405 struct request_sock *req, **prev; 405 struct request_sock *req, **prev;
406 406
407 for (prev = &lopt->syn_table[tcp_v6_synq_hash(raddr, rport, lopt->hash_rnd)]; 407 for (prev = &lopt->syn_table[tcp_v6_synq_hash(raddr, rport, lopt->hash_rnd)];
@@ -1267,18 +1267,10 @@ static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
1267static void tcp_v6_synq_add(struct sock *sk, struct request_sock *req) 1267static void tcp_v6_synq_add(struct sock *sk, struct request_sock *req)
1268{ 1268{
1269 struct tcp_sock *tp = tcp_sk(sk); 1269 struct tcp_sock *tp = tcp_sk(sk);
1270 struct tcp_listen_opt *lopt = tp->listen_opt; 1270 struct tcp_listen_opt *lopt = tp->accept_queue.listen_opt;
1271 u32 h = tcp_v6_synq_hash(&tcp6_rsk(req)->rmt_addr, inet_rsk(req)->rmt_port, lopt->hash_rnd); 1271 u32 h = tcp_v6_synq_hash(&tcp6_rsk(req)->rmt_addr, inet_rsk(req)->rmt_port, lopt->hash_rnd);
1272 1272
1273 req->sk = NULL; 1273 reqsk_queue_hash_req(&tp->accept_queue, h, req, TCP_TIMEOUT_INIT);
1274 req->expires = jiffies + TCP_TIMEOUT_INIT;
1275 req->retrans = 0;
1276 req->dl_next = lopt->syn_table[h];
1277
1278 write_lock(&tp->syn_wait_lock);
1279 lopt->syn_table[h] = req;
1280 write_unlock(&tp->syn_wait_lock);
1281
1282 tcp_synq_added(sk); 1274 tcp_synq_added(sk);
1283} 1275}
1284 1276