aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@ghostprotocols.net>2005-06-19 01:47:21 -0400
committerDavid S. Miller <davem@davemloft.net>2005-06-19 01:47:21 -0400
commit60236fdd08b2169045a3bbfc5ffe1576e6c3c17b (patch)
tree4541c682cc72daf560ec516e2b5868089a88b6ea /net
parent2e6599cb899ba4b133f42cbf9d2b1883d2dc583a (diff)
[NET] Rename open_request to request_sock
Ok, this one just renames some stuff to have a better namespace and to dissassociate it from TCP: struct open_request -> struct request_sock tcp_openreq_alloc -> reqsk_alloc tcp_openreq_free -> reqsk_free tcp_openreq_fastfree -> __reqsk_free With this most of the infrastructure closely resembles a struct sock methods subset. Signed-off-by: Arnaldo Carvalho de Melo <acme@ghostprotocols.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv4/syncookies.c12
-rw-r--r--net/ipv4/tcp.c12
-rw-r--r--net/ipv4/tcp_diag.c4
-rw-r--r--net/ipv4/tcp_ipv4.c56
-rw-r--r--net/ipv4/tcp_minisocks.c14
-rw-r--r--net/ipv4/tcp_output.c2
-rw-r--r--net/ipv4/tcp_timer.c6
-rw-r--r--net/ipv6/tcp_ipv6.c42
8 files changed, 74 insertions, 74 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index dd47e6da6fb3..72d014442185 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -169,10 +169,10 @@ static inline int cookie_check(struct sk_buff *skb, __u32 cookie)
169 return mssind < NUM_MSS ? msstab[mssind] + 1 : 0; 169 return mssind < NUM_MSS ? msstab[mssind] + 1 : 0;
170} 170}
171 171
172extern struct or_calltable or_ipv4; 172extern struct request_sock_ops tcp_request_sock_ops;
173 173
174static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb, 174static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb,
175 struct open_request *req, 175 struct request_sock *req,
176 struct dst_entry *dst) 176 struct dst_entry *dst)
177{ 177{
178 struct tcp_sock *tp = tcp_sk(sk); 178 struct tcp_sock *tp = tcp_sk(sk);
@@ -182,7 +182,7 @@ static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb,
182 if (child) 182 if (child)
183 tcp_acceptq_queue(sk, req, child); 183 tcp_acceptq_queue(sk, req, child);
184 else 184 else
185 tcp_openreq_free(req); 185 reqsk_free(req);
186 186
187 return child; 187 return child;
188} 188}
@@ -195,7 +195,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
195 struct tcp_sock *tp = tcp_sk(sk); 195 struct tcp_sock *tp = tcp_sk(sk);
196 __u32 cookie = ntohl(skb->h.th->ack_seq) - 1; 196 __u32 cookie = ntohl(skb->h.th->ack_seq) - 1;
197 struct sock *ret = sk; 197 struct sock *ret = sk;
198 struct open_request *req; 198 struct request_sock *req;
199 int mss; 199 int mss;
200 struct rtable *rt; 200 struct rtable *rt;
201 __u8 rcv_wscale; 201 __u8 rcv_wscale;
@@ -212,7 +212,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
212 NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESRECV); 212 NET_INC_STATS_BH(LINUX_MIB_SYNCOOKIESRECV);
213 213
214 ret = NULL; 214 ret = NULL;
215 req = tcp_openreq_alloc(&or_ipv4); /* for safety */ 215 req = reqsk_alloc(&tcp_request_sock_ops); /* for safety */
216 if (!req) 216 if (!req)
217 goto out; 217 goto out;
218 218
@@ -262,7 +262,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
262 { .sport = skb->h.th->dest, 262 { .sport = skb->h.th->dest,
263 .dport = skb->h.th->source } } }; 263 .dport = skb->h.th->source } } };
264 if (ip_route_output_key(&rt, &fl)) { 264 if (ip_route_output_key(&rt, &fl)) {
265 tcp_openreq_free(req); 265 reqsk_free(req);
266 goto out; 266 goto out;
267 } 267 }
268 } 268 }
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index a3cabfa2022a..1c29feb6b35f 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -516,8 +516,8 @@ static void tcp_listen_stop (struct sock *sk)
516{ 516{
517 struct tcp_sock *tp = tcp_sk(sk); 517 struct tcp_sock *tp = tcp_sk(sk);
518 struct tcp_listen_opt *lopt = tp->listen_opt; 518 struct tcp_listen_opt *lopt = tp->listen_opt;
519 struct open_request *acc_req = tp->accept_queue; 519 struct request_sock *acc_req = tp->accept_queue;
520 struct open_request *req; 520 struct request_sock *req;
521 int i; 521 int i;
522 522
523 tcp_delete_keepalive_timer(sk); 523 tcp_delete_keepalive_timer(sk);
@@ -533,7 +533,7 @@ static void tcp_listen_stop (struct sock *sk)
533 while ((req = lopt->syn_table[i]) != NULL) { 533 while ((req = lopt->syn_table[i]) != NULL) {
534 lopt->syn_table[i] = req->dl_next; 534 lopt->syn_table[i] = req->dl_next;
535 lopt->qlen--; 535 lopt->qlen--;
536 tcp_openreq_free(req); 536 reqsk_free(req);
537 537
538 /* Following specs, it would be better either to send FIN 538 /* Following specs, it would be better either to send FIN
539 * (and enter FIN-WAIT-1, it is normal close) 539 * (and enter FIN-WAIT-1, it is normal close)
@@ -573,7 +573,7 @@ static void tcp_listen_stop (struct sock *sk)
573 sock_put(child); 573 sock_put(child);
574 574
575 sk_acceptq_removed(sk); 575 sk_acceptq_removed(sk);
576 tcp_openreq_fastfree(req); 576 __reqsk_free(req);
577 } 577 }
578 BUG_TRAP(!sk->sk_ack_backlog); 578 BUG_TRAP(!sk->sk_ack_backlog);
579} 579}
@@ -1894,7 +1894,7 @@ static int wait_for_connect(struct sock *sk, long timeo)
1894struct sock *tcp_accept(struct sock *sk, int flags, int *err) 1894struct sock *tcp_accept(struct sock *sk, int flags, int *err)
1895{ 1895{
1896 struct tcp_sock *tp = tcp_sk(sk); 1896 struct tcp_sock *tp = tcp_sk(sk);
1897 struct open_request *req; 1897 struct request_sock *req;
1898 struct sock *newsk; 1898 struct sock *newsk;
1899 int error; 1899 int error;
1900 1900
@@ -1927,7 +1927,7 @@ struct sock *tcp_accept(struct sock *sk, int flags, int *err)
1927 1927
1928 newsk = req->sk; 1928 newsk = req->sk;
1929 sk_acceptq_removed(sk); 1929 sk_acceptq_removed(sk);
1930 tcp_openreq_fastfree(req); 1930 __reqsk_free(req);
1931 BUG_TRAP(newsk->sk_state != TCP_SYN_RECV); 1931 BUG_TRAP(newsk->sk_state != TCP_SYN_RECV);
1932 release_sock(sk); 1932 release_sock(sk);
1933 return newsk; 1933 return newsk;
diff --git a/net/ipv4/tcp_diag.c b/net/ipv4/tcp_diag.c
index 700ff2413588..67277800d0c1 100644
--- a/net/ipv4/tcp_diag.c
+++ b/net/ipv4/tcp_diag.c
@@ -455,7 +455,7 @@ static int tcpdiag_dump_sock(struct sk_buff *skb, struct sock *sk,
455} 455}
456 456
457static int tcpdiag_fill_req(struct sk_buff *skb, struct sock *sk, 457static int tcpdiag_fill_req(struct sk_buff *skb, struct sock *sk,
458 struct open_request *req, 458 struct request_sock *req,
459 u32 pid, u32 seq) 459 u32 pid, u32 seq)
460{ 460{
461 const struct inet_request_sock *ireq = inet_rsk(req); 461 const struct inet_request_sock *ireq = inet_rsk(req);
@@ -542,7 +542,7 @@ static int tcpdiag_dump_reqs(struct sk_buff *skb, struct sock *sk,
542 } 542 }
543 543
544 for (j = s_j; j < TCP_SYNQ_HSIZE; j++) { 544 for (j = s_j; j < TCP_SYNQ_HSIZE; j++) {
545 struct open_request *req, *head = lopt->syn_table[j]; 545 struct request_sock *req, *head = lopt->syn_table[j];
546 546
547 reqnum = 0; 547 reqnum = 0;
548 for (req = head; req; reqnum++, req = req->dl_next) { 548 for (req = head; req; reqnum++, req = req->dl_next) {
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index e156be90df14..95528a75a63d 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -36,7 +36,7 @@
36 * ACK bit. 36 * ACK bit.
37 * Andi Kleen : Implemented fast path mtu discovery. 37 * Andi Kleen : Implemented fast path mtu discovery.
38 * Fixed many serious bugs in the 38 * Fixed many serious bugs in the
39 * open_request handling and moved 39 * request_sock handling and moved
40 * most of it into the af independent code. 40 * most of it into the af independent code.
41 * Added tail drop and some other bugfixes. 41 * Added tail drop and some other bugfixes.
42 * Added new listen sematics. 42 * Added new listen sematics.
@@ -869,13 +869,13 @@ static __inline__ u32 tcp_v4_synq_hash(u32 raddr, u16 rport, u32 rnd)
869 return (jhash_2words(raddr, (u32) rport, rnd) & (TCP_SYNQ_HSIZE - 1)); 869 return (jhash_2words(raddr, (u32) rport, rnd) & (TCP_SYNQ_HSIZE - 1));
870} 870}
871 871
872static struct open_request *tcp_v4_search_req(struct tcp_sock *tp, 872static struct request_sock *tcp_v4_search_req(struct tcp_sock *tp,
873 struct open_request ***prevp, 873 struct request_sock ***prevp,
874 __u16 rport, 874 __u16 rport,
875 __u32 raddr, __u32 laddr) 875 __u32 raddr, __u32 laddr)
876{ 876{
877 struct tcp_listen_opt *lopt = tp->listen_opt; 877 struct tcp_listen_opt *lopt = tp->listen_opt;
878 struct open_request *req, **prev; 878 struct request_sock *req, **prev;
879 879
880 for (prev = &lopt->syn_table[tcp_v4_synq_hash(raddr, rport, lopt->hash_rnd)]; 880 for (prev = &lopt->syn_table[tcp_v4_synq_hash(raddr, rport, lopt->hash_rnd)];
881 (req = *prev) != NULL; 881 (req = *prev) != NULL;
@@ -885,7 +885,7 @@ static struct open_request *tcp_v4_search_req(struct tcp_sock *tp,
885 if (ireq->rmt_port == rport && 885 if (ireq->rmt_port == rport &&
886 ireq->rmt_addr == raddr && 886 ireq->rmt_addr == raddr &&
887 ireq->loc_addr == laddr && 887 ireq->loc_addr == laddr &&
888 TCP_INET_FAMILY(req->class->family)) { 888 TCP_INET_FAMILY(req->rsk_ops->family)) {
889 BUG_TRAP(!req->sk); 889 BUG_TRAP(!req->sk);
890 *prevp = prev; 890 *prevp = prev;
891 break; 891 break;
@@ -895,7 +895,7 @@ static struct open_request *tcp_v4_search_req(struct tcp_sock *tp,
895 return req; 895 return req;
896} 896}
897 897
898static void tcp_v4_synq_add(struct sock *sk, struct open_request *req) 898static void tcp_v4_synq_add(struct sock *sk, struct request_sock *req)
899{ 899{
900 struct tcp_sock *tp = tcp_sk(sk); 900 struct tcp_sock *tp = tcp_sk(sk);
901 struct tcp_listen_opt *lopt = tp->listen_opt; 901 struct tcp_listen_opt *lopt = tp->listen_opt;
@@ -1052,7 +1052,7 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
1052 } 1052 }
1053 1053
1054 switch (sk->sk_state) { 1054 switch (sk->sk_state) {
1055 struct open_request *req, **prev; 1055 struct request_sock *req, **prev;
1056 case TCP_LISTEN: 1056 case TCP_LISTEN:
1057 if (sock_owned_by_user(sk)) 1057 if (sock_owned_by_user(sk))
1058 goto out; 1058 goto out;
@@ -1256,14 +1256,14 @@ static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb)
1256 tcp_tw_put(tw); 1256 tcp_tw_put(tw);
1257} 1257}
1258 1258
1259static void tcp_v4_or_send_ack(struct sk_buff *skb, struct open_request *req) 1259static void tcp_v4_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req)
1260{ 1260{
1261 tcp_v4_send_ack(skb, tcp_rsk(req)->snt_isn + 1, tcp_rsk(req)->rcv_isn + 1, req->rcv_wnd, 1261 tcp_v4_send_ack(skb, tcp_rsk(req)->snt_isn + 1, tcp_rsk(req)->rcv_isn + 1, req->rcv_wnd,
1262 req->ts_recent); 1262 req->ts_recent);
1263} 1263}
1264 1264
1265static struct dst_entry* tcp_v4_route_req(struct sock *sk, 1265static struct dst_entry* tcp_v4_route_req(struct sock *sk,
1266 struct open_request *req) 1266 struct request_sock *req)
1267{ 1267{
1268 struct rtable *rt; 1268 struct rtable *rt;
1269 const struct inet_request_sock *ireq = inet_rsk(req); 1269 const struct inet_request_sock *ireq = inet_rsk(req);
@@ -1294,10 +1294,10 @@ static struct dst_entry* tcp_v4_route_req(struct sock *sk,
1294 1294
1295/* 1295/*
1296 * Send a SYN-ACK after having received an ACK. 1296 * Send a SYN-ACK after having received an ACK.
1297 * This still operates on a open_request only, not on a big 1297 * This still operates on a request_sock only, not on a big
1298 * socket. 1298 * socket.
1299 */ 1299 */
1300static int tcp_v4_send_synack(struct sock *sk, struct open_request *req, 1300static int tcp_v4_send_synack(struct sock *sk, struct request_sock *req,
1301 struct dst_entry *dst) 1301 struct dst_entry *dst)
1302{ 1302{
1303 const struct inet_request_sock *ireq = inet_rsk(req); 1303 const struct inet_request_sock *ireq = inet_rsk(req);
@@ -1332,9 +1332,9 @@ out:
1332} 1332}
1333 1333
1334/* 1334/*
1335 * IPv4 open_request destructor. 1335 * IPv4 request_sock destructor.
1336 */ 1336 */
1337static void tcp_v4_or_free(struct open_request *req) 1337static void tcp_v4_reqsk_destructor(struct request_sock *req)
1338{ 1338{
1339 if (inet_rsk(req)->opt) 1339 if (inet_rsk(req)->opt)
1340 kfree(inet_rsk(req)->opt); 1340 kfree(inet_rsk(req)->opt);
@@ -1353,7 +1353,7 @@ static inline void syn_flood_warning(struct sk_buff *skb)
1353} 1353}
1354 1354
1355/* 1355/*
1356 * Save and compile IPv4 options into the open_request if needed. 1356 * Save and compile IPv4 options into the request_sock if needed.
1357 */ 1357 */
1358static inline struct ip_options *tcp_v4_save_options(struct sock *sk, 1358static inline struct ip_options *tcp_v4_save_options(struct sock *sk,
1359 struct sk_buff *skb) 1359 struct sk_buff *skb)
@@ -1389,12 +1389,12 @@ static inline struct ip_options *tcp_v4_save_options(struct sock *sk,
1389 */ 1389 */
1390int sysctl_max_syn_backlog = 256; 1390int sysctl_max_syn_backlog = 256;
1391 1391
1392struct or_calltable or_ipv4 = { 1392struct request_sock_ops tcp_request_sock_ops = {
1393 .family = PF_INET, 1393 .family = PF_INET,
1394 .obj_size = sizeof(struct tcp_request_sock), 1394 .obj_size = sizeof(struct tcp_request_sock),
1395 .rtx_syn_ack = tcp_v4_send_synack, 1395 .rtx_syn_ack = tcp_v4_send_synack,
1396 .send_ack = tcp_v4_or_send_ack, 1396 .send_ack = tcp_v4_reqsk_send_ack,
1397 .destructor = tcp_v4_or_free, 1397 .destructor = tcp_v4_reqsk_destructor,
1398 .send_reset = tcp_v4_send_reset, 1398 .send_reset = tcp_v4_send_reset,
1399}; 1399};
1400 1400
@@ -1402,7 +1402,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
1402{ 1402{
1403 struct inet_request_sock *ireq; 1403 struct inet_request_sock *ireq;
1404 struct tcp_options_received tmp_opt; 1404 struct tcp_options_received tmp_opt;
1405 struct open_request *req; 1405 struct request_sock *req;
1406 __u32 saddr = skb->nh.iph->saddr; 1406 __u32 saddr = skb->nh.iph->saddr;
1407 __u32 daddr = skb->nh.iph->daddr; 1407 __u32 daddr = skb->nh.iph->daddr;
1408 __u32 isn = TCP_SKB_CB(skb)->when; 1408 __u32 isn = TCP_SKB_CB(skb)->when;
@@ -1439,7 +1439,7 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
1439 if (sk_acceptq_is_full(sk) && tcp_synq_young(sk) > 1) 1439 if (sk_acceptq_is_full(sk) && tcp_synq_young(sk) > 1)
1440 goto drop; 1440 goto drop;
1441 1441
1442 req = tcp_openreq_alloc(&or_ipv4); 1442 req = reqsk_alloc(&tcp_request_sock_ops);
1443 if (!req) 1443 if (!req)
1444 goto drop; 1444 goto drop;
1445 1445
@@ -1535,14 +1535,14 @@ int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
1535 goto drop_and_free; 1535 goto drop_and_free;
1536 1536
1537 if (want_cookie) { 1537 if (want_cookie) {
1538 tcp_openreq_free(req); 1538 reqsk_free(req);
1539 } else { 1539 } else {
1540 tcp_v4_synq_add(sk, req); 1540 tcp_v4_synq_add(sk, req);
1541 } 1541 }
1542 return 0; 1542 return 0;
1543 1543
1544drop_and_free: 1544drop_and_free:
1545 tcp_openreq_free(req); 1545 reqsk_free(req);
1546drop: 1546drop:
1547 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS); 1547 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
1548 return 0; 1548 return 0;
@@ -1554,7 +1554,7 @@ drop:
1554 * now create the new socket. 1554 * now create the new socket.
1555 */ 1555 */
1556struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, 1556struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1557 struct open_request *req, 1557 struct request_sock *req,
1558 struct dst_entry *dst) 1558 struct dst_entry *dst)
1559{ 1559{
1560 struct inet_request_sock *ireq; 1560 struct inet_request_sock *ireq;
@@ -1613,9 +1613,9 @@ static struct sock *tcp_v4_hnd_req(struct sock *sk, struct sk_buff *skb)
1613 struct iphdr *iph = skb->nh.iph; 1613 struct iphdr *iph = skb->nh.iph;
1614 struct tcp_sock *tp = tcp_sk(sk); 1614 struct tcp_sock *tp = tcp_sk(sk);
1615 struct sock *nsk; 1615 struct sock *nsk;
1616 struct open_request **prev; 1616 struct request_sock **prev;
1617 /* Find possible connection requests. */ 1617 /* Find possible connection requests. */
1618 struct open_request *req = tcp_v4_search_req(tp, &prev, th->source, 1618 struct request_sock *req = tcp_v4_search_req(tp, &prev, th->source,
1619 iph->saddr, iph->daddr); 1619 iph->saddr, iph->daddr);
1620 if (req) 1620 if (req)
1621 return tcp_check_req(sk, skb, req, prev); 1621 return tcp_check_req(sk, skb, req, prev);
@@ -2152,13 +2152,13 @@ static void *listening_get_next(struct seq_file *seq, void *cur)
2152 ++st->num; 2152 ++st->num;
2153 2153
2154 if (st->state == TCP_SEQ_STATE_OPENREQ) { 2154 if (st->state == TCP_SEQ_STATE_OPENREQ) {
2155 struct open_request *req = cur; 2155 struct request_sock *req = cur;
2156 2156
2157 tp = tcp_sk(st->syn_wait_sk); 2157 tp = tcp_sk(st->syn_wait_sk);
2158 req = req->dl_next; 2158 req = req->dl_next;
2159 while (1) { 2159 while (1) {
2160 while (req) { 2160 while (req) {
2161 if (req->class->family == st->family) { 2161 if (req->rsk_ops->family == st->family) {
2162 cur = req; 2162 cur = req;
2163 goto out; 2163 goto out;
2164 } 2164 }
@@ -2459,7 +2459,7 @@ void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo)
2459 memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops)); 2459 memset(afinfo->seq_fops, 0, sizeof(*afinfo->seq_fops));
2460} 2460}
2461 2461
2462static void get_openreq4(struct sock *sk, struct open_request *req, 2462static void get_openreq4(struct sock *sk, struct request_sock *req,
2463 char *tmpbuf, int i, int uid) 2463 char *tmpbuf, int i, int uid)
2464{ 2464{
2465 const struct inet_request_sock *ireq = inet_rsk(req); 2465 const struct inet_request_sock *ireq = inet_rsk(req);
@@ -2627,7 +2627,7 @@ struct proto tcp_prot = {
2627 .sysctl_rmem = sysctl_tcp_rmem, 2627 .sysctl_rmem = sysctl_tcp_rmem,
2628 .max_header = MAX_TCP_HEADER, 2628 .max_header = MAX_TCP_HEADER,
2629 .obj_size = sizeof(struct tcp_sock), 2629 .obj_size = sizeof(struct tcp_sock),
2630 .rsk_prot = &or_ipv4, 2630 .rsk_prot = &tcp_request_sock_ops,
2631}; 2631};
2632 2632
2633 2633
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 1037401c7cc8..0e6d525a8341 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -684,7 +684,7 @@ out:
684 * Actually, we could lots of memory writes here. tp of listening 684 * Actually, we could lots of memory writes here. tp of listening
685 * socket contains all necessary default parameters. 685 * socket contains all necessary default parameters.
686 */ 686 */
687struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req, struct sk_buff *skb) 687struct sock *tcp_create_openreq_child(struct sock *sk, struct request_sock *req, struct sk_buff *skb)
688{ 688{
689 /* allocate the newsk from the same slab of the master sock, 689 /* allocate the newsk from the same slab of the master sock,
690 * if not, at sk_free time we'll try to free it from the wrong 690 * if not, at sk_free time we'll try to free it from the wrong
@@ -853,12 +853,12 @@ struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req,
853 853
854/* 854/*
855 * Process an incoming packet for SYN_RECV sockets represented 855 * Process an incoming packet for SYN_RECV sockets represented
856 * as an open_request. 856 * as a request_sock.
857 */ 857 */
858 858
859struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb, 859struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
860 struct open_request *req, 860 struct request_sock *req,
861 struct open_request **prev) 861 struct request_sock **prev)
862{ 862{
863 struct tcphdr *th = skb->h.th; 863 struct tcphdr *th = skb->h.th;
864 struct tcp_sock *tp = tcp_sk(sk); 864 struct tcp_sock *tp = tcp_sk(sk);
@@ -903,7 +903,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
903 * Enforce "SYN-ACK" according to figure 8, figure 6 903 * Enforce "SYN-ACK" according to figure 8, figure 6
904 * of RFC793, fixed by RFC1122. 904 * of RFC793, fixed by RFC1122.
905 */ 905 */
906 req->class->rtx_syn_ack(sk, req, NULL); 906 req->rsk_ops->rtx_syn_ack(sk, req, NULL);
907 return NULL; 907 return NULL;
908 } 908 }
909 909
@@ -975,7 +975,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
975 tcp_rsk(req)->rcv_isn + 1, tcp_rsk(req)->rcv_isn + 1 + req->rcv_wnd)) { 975 tcp_rsk(req)->rcv_isn + 1, tcp_rsk(req)->rcv_isn + 1 + req->rcv_wnd)) {
976 /* Out of window: send ACK and drop. */ 976 /* Out of window: send ACK and drop. */
977 if (!(flg & TCP_FLAG_RST)) 977 if (!(flg & TCP_FLAG_RST))
978 req->class->send_ack(skb, req); 978 req->rsk_ops->send_ack(skb, req);
979 if (paws_reject) 979 if (paws_reject)
980 NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED); 980 NET_INC_STATS_BH(LINUX_MIB_PAWSESTABREJECTED);
981 return NULL; 981 return NULL;
@@ -1035,7 +1035,7 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
1035 embryonic_reset: 1035 embryonic_reset:
1036 NET_INC_STATS_BH(LINUX_MIB_EMBRYONICRSTS); 1036 NET_INC_STATS_BH(LINUX_MIB_EMBRYONICRSTS);
1037 if (!(flg & TCP_FLAG_RST)) 1037 if (!(flg & TCP_FLAG_RST))
1038 req->class->send_reset(skb); 1038 req->rsk_ops->send_reset(skb);
1039 1039
1040 tcp_synq_drop(sk, req, prev); 1040 tcp_synq_drop(sk, req, prev);
1041 return NULL; 1041 return NULL;
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index f3c8747caf91..f17c6577e337 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -1356,7 +1356,7 @@ int tcp_send_synack(struct sock *sk)
1356 * Prepare a SYN-ACK. 1356 * Prepare a SYN-ACK.
1357 */ 1357 */
1358struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, 1358struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst,
1359 struct open_request *req) 1359 struct request_sock *req)
1360{ 1360{
1361 struct inet_request_sock *ireq = inet_rsk(req); 1361 struct inet_request_sock *ireq = inet_rsk(req);
1362 struct tcp_sock *tp = tcp_sk(sk); 1362 struct tcp_sock *tp = tcp_sk(sk);
diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c
index ba30ca0aa6a3..f03efe5fb76a 100644
--- a/net/ipv4/tcp_timer.c
+++ b/net/ipv4/tcp_timer.c
@@ -468,7 +468,7 @@ static void tcp_synack_timer(struct sock *sk)
468 int max_retries = tp->syn_retries ? : sysctl_tcp_synack_retries; 468 int max_retries = tp->syn_retries ? : sysctl_tcp_synack_retries;
469 int thresh = max_retries; 469 int thresh = max_retries;
470 unsigned long now = jiffies; 470 unsigned long now = jiffies;
471 struct open_request **reqp, *req; 471 struct request_sock **reqp, *req;
472 int i, budget; 472 int i, budget;
473 473
474 if (lopt == NULL || lopt->qlen == 0) 474 if (lopt == NULL || lopt->qlen == 0)
@@ -514,7 +514,7 @@ static void tcp_synack_timer(struct sock *sk)
514 if (time_after_eq(now, req->expires)) { 514 if (time_after_eq(now, req->expires)) {
515 if ((req->retrans < thresh || 515 if ((req->retrans < thresh ||
516 (inet_rsk(req)->acked && req->retrans < max_retries)) 516 (inet_rsk(req)->acked && req->retrans < max_retries))
517 && !req->class->rtx_syn_ack(sk, req, NULL)) { 517 && !req->rsk_ops->rtx_syn_ack(sk, req, NULL)) {
518 unsigned long timeo; 518 unsigned long timeo;
519 519
520 if (req->retrans++ == 0) 520 if (req->retrans++ == 0)
@@ -533,7 +533,7 @@ static void tcp_synack_timer(struct sock *sk)
533 lopt->qlen--; 533 lopt->qlen--;
534 if (req->retrans == 0) 534 if (req->retrans == 0)
535 lopt->qlen_young--; 535 lopt->qlen_young--;
536 tcp_openreq_free(req); 536 reqsk_free(req);
537 continue; 537 continue;
538 } 538 }
539 reqp = &req->dl_next; 539 reqp = &req->dl_next;
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
index 9199ad2fde0d..068cd4a8c292 100644
--- a/net/ipv6/tcp_ipv6.c
+++ b/net/ipv6/tcp_ipv6.c
@@ -65,7 +65,7 @@
65#include <linux/seq_file.h> 65#include <linux/seq_file.h>
66 66
67static void tcp_v6_send_reset(struct sk_buff *skb); 67static void tcp_v6_send_reset(struct sk_buff *skb);
68static void tcp_v6_or_send_ack(struct sk_buff *skb, struct open_request *req); 68static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req);
69static void tcp_v6_send_check(struct sock *sk, struct tcphdr *th, int len, 69static void tcp_v6_send_check(struct sock *sk, struct tcphdr *th, int len,
70 struct sk_buff *skb); 70 struct sk_buff *skb);
71 71
@@ -394,15 +394,15 @@ static u32 tcp_v6_synq_hash(struct in6_addr *raddr, u16 rport, u32 rnd)
394 return c & (TCP_SYNQ_HSIZE - 1); 394 return c & (TCP_SYNQ_HSIZE - 1);
395} 395}
396 396
397static struct open_request *tcp_v6_search_req(struct tcp_sock *tp, 397static struct request_sock *tcp_v6_search_req(struct tcp_sock *tp,
398 struct open_request ***prevp, 398 struct request_sock ***prevp,
399 __u16 rport, 399 __u16 rport,
400 struct in6_addr *raddr, 400 struct in6_addr *raddr,
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->listen_opt;
405 struct open_request *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)];
408 (req = *prev) != NULL; 408 (req = *prev) != NULL;
@@ -410,7 +410,7 @@ static struct open_request *tcp_v6_search_req(struct tcp_sock *tp,
410 const struct tcp6_request_sock *treq = tcp6_rsk(req); 410 const struct tcp6_request_sock *treq = tcp6_rsk(req);
411 411
412 if (inet_rsk(req)->rmt_port == rport && 412 if (inet_rsk(req)->rmt_port == rport &&
413 req->class->family == AF_INET6 && 413 req->rsk_ops->family == AF_INET6 &&
414 ipv6_addr_equal(&treq->rmt_addr, raddr) && 414 ipv6_addr_equal(&treq->rmt_addr, raddr) &&
415 ipv6_addr_equal(&treq->loc_addr, laddr) && 415 ipv6_addr_equal(&treq->loc_addr, laddr) &&
416 (!treq->iif || treq->iif == iif)) { 416 (!treq->iif || treq->iif == iif)) {
@@ -908,9 +908,9 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
908 908
909 icmpv6_err_convert(type, code, &err); 909 icmpv6_err_convert(type, code, &err);
910 910
911 /* Might be for an open_request */ 911 /* Might be for an request_sock */
912 switch (sk->sk_state) { 912 switch (sk->sk_state) {
913 struct open_request *req, **prev; 913 struct request_sock *req, **prev;
914 case TCP_LISTEN: 914 case TCP_LISTEN:
915 if (sock_owned_by_user(sk)) 915 if (sock_owned_by_user(sk))
916 goto out; 916 goto out;
@@ -959,7 +959,7 @@ out:
959} 959}
960 960
961 961
962static int tcp_v6_send_synack(struct sock *sk, struct open_request *req, 962static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req,
963 struct dst_entry *dst) 963 struct dst_entry *dst)
964{ 964{
965 struct tcp6_request_sock *treq = tcp6_rsk(req); 965 struct tcp6_request_sock *treq = tcp6_rsk(req);
@@ -1027,18 +1027,18 @@ done:
1027 return err; 1027 return err;
1028} 1028}
1029 1029
1030static void tcp_v6_or_free(struct open_request *req) 1030static void tcp_v6_reqsk_destructor(struct request_sock *req)
1031{ 1031{
1032 if (tcp6_rsk(req)->pktopts) 1032 if (tcp6_rsk(req)->pktopts)
1033 kfree_skb(tcp6_rsk(req)->pktopts); 1033 kfree_skb(tcp6_rsk(req)->pktopts);
1034} 1034}
1035 1035
1036static struct or_calltable or_ipv6 = { 1036static struct request_sock_ops tcp6_request_sock_ops = {
1037 .family = AF_INET6, 1037 .family = AF_INET6,
1038 .obj_size = sizeof(struct tcp6_request_sock), 1038 .obj_size = sizeof(struct tcp6_request_sock),
1039 .rtx_syn_ack = tcp_v6_send_synack, 1039 .rtx_syn_ack = tcp_v6_send_synack,
1040 .send_ack = tcp_v6_or_send_ack, 1040 .send_ack = tcp_v6_reqsk_send_ack,
1041 .destructor = tcp_v6_or_free, 1041 .destructor = tcp_v6_reqsk_destructor,
1042 .send_reset = tcp_v6_send_reset 1042 .send_reset = tcp_v6_send_reset
1043}; 1043};
1044 1044
@@ -1223,7 +1223,7 @@ static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb)
1223 tcp_tw_put(tw); 1223 tcp_tw_put(tw);
1224} 1224}
1225 1225
1226static void tcp_v6_or_send_ack(struct sk_buff *skb, struct open_request *req) 1226static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req)
1227{ 1227{
1228 tcp_v6_send_ack(skb, tcp_rsk(req)->snt_isn + 1, tcp_rsk(req)->rcv_isn + 1, req->rcv_wnd, req->ts_recent); 1228 tcp_v6_send_ack(skb, tcp_rsk(req)->snt_isn + 1, tcp_rsk(req)->rcv_isn + 1, req->rcv_wnd, req->ts_recent);
1229} 1229}
@@ -1231,7 +1231,7 @@ static void tcp_v6_or_send_ack(struct sk_buff *skb, struct open_request *req)
1231 1231
1232static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) 1232static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
1233{ 1233{
1234 struct open_request *req, **prev; 1234 struct request_sock *req, **prev;
1235 struct tcphdr *th = skb->h.th; 1235 struct tcphdr *th = skb->h.th;
1236 struct tcp_sock *tp = tcp_sk(sk); 1236 struct tcp_sock *tp = tcp_sk(sk);
1237 struct sock *nsk; 1237 struct sock *nsk;
@@ -1264,7 +1264,7 @@ static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
1264 return sk; 1264 return sk;
1265} 1265}
1266 1266
1267static void tcp_v6_synq_add(struct sock *sk, struct open_request *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->listen_opt;
@@ -1292,7 +1292,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
1292 struct ipv6_pinfo *np = inet6_sk(sk); 1292 struct ipv6_pinfo *np = inet6_sk(sk);
1293 struct tcp_options_received tmp_opt; 1293 struct tcp_options_received tmp_opt;
1294 struct tcp_sock *tp = tcp_sk(sk); 1294 struct tcp_sock *tp = tcp_sk(sk);
1295 struct open_request *req = NULL; 1295 struct request_sock *req = NULL;
1296 __u32 isn = TCP_SKB_CB(skb)->when; 1296 __u32 isn = TCP_SKB_CB(skb)->when;
1297 1297
1298 if (skb->protocol == htons(ETH_P_IP)) 1298 if (skb->protocol == htons(ETH_P_IP))
@@ -1313,7 +1313,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
1313 if (sk_acceptq_is_full(sk) && tcp_synq_young(sk) > 1) 1313 if (sk_acceptq_is_full(sk) && tcp_synq_young(sk) > 1)
1314 goto drop; 1314 goto drop;
1315 1315
1316 req = tcp_openreq_alloc(&or_ipv6); 1316 req = reqsk_alloc(&tcp6_request_sock_ops);
1317 if (req == NULL) 1317 if (req == NULL)
1318 goto drop; 1318 goto drop;
1319 1319
@@ -1358,14 +1358,14 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
1358 1358
1359drop: 1359drop:
1360 if (req) 1360 if (req)
1361 tcp_openreq_free(req); 1361 reqsk_free(req);
1362 1362
1363 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS); 1363 TCP_INC_STATS_BH(TCP_MIB_ATTEMPTFAILS);
1364 return 0; /* don't send reset */ 1364 return 0; /* don't send reset */
1365} 1365}
1366 1366
1367static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, 1367static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1368 struct open_request *req, 1368 struct request_sock *req,
1369 struct dst_entry *dst) 1369 struct dst_entry *dst)
1370{ 1370{
1371 struct tcp6_request_sock *treq = tcp6_rsk(req); 1371 struct tcp6_request_sock *treq = tcp6_rsk(req);
@@ -2055,7 +2055,7 @@ static int tcp_v6_destroy_sock(struct sock *sk)
2055 2055
2056/* Proc filesystem TCPv6 sock list dumping. */ 2056/* Proc filesystem TCPv6 sock list dumping. */
2057static void get_openreq6(struct seq_file *seq, 2057static void get_openreq6(struct seq_file *seq,
2058 struct sock *sk, struct open_request *req, int i, int uid) 2058 struct sock *sk, struct request_sock *req, int i, int uid)
2059{ 2059{
2060 struct in6_addr *dest, *src; 2060 struct in6_addr *dest, *src;
2061 int ttd = req->expires - jiffies; 2061 int ttd = req->expires - jiffies;
@@ -2244,7 +2244,7 @@ struct proto tcpv6_prot = {
2244 .sysctl_rmem = sysctl_tcp_rmem, 2244 .sysctl_rmem = sysctl_tcp_rmem,
2245 .max_header = MAX_TCP_HEADER, 2245 .max_header = MAX_TCP_HEADER,
2246 .obj_size = sizeof(struct tcp6_sock), 2246 .obj_size = sizeof(struct tcp6_sock),
2247 .rsk_prot = &or_ipv6, 2247 .rsk_prot = &tcp6_request_sock_ops,
2248}; 2248};
2249 2249
2250static struct inet6_protocol tcpv6_protocol = { 2250static struct inet6_protocol tcpv6_protocol = {