diff options
-rw-r--r-- | include/linux/ip.h | 4 | ||||
-rw-r--r-- | include/linux/ipv6.h | 2 | ||||
-rw-r--r-- | include/linux/tcp.h | 6 | ||||
-rw-r--r-- | include/net/request_sock.h | 34 | ||||
-rw-r--r-- | include/net/sock.h | 4 | ||||
-rw-r--r-- | include/net/tcp.h | 30 | ||||
-rw-r--r-- | include/net/tcp_ecn.h | 6 | ||||
-rw-r--r-- | net/ipv4/syncookies.c | 12 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 12 | ||||
-rw-r--r-- | net/ipv4/tcp_diag.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 56 | ||||
-rw-r--r-- | net/ipv4/tcp_minisocks.c | 14 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp_timer.c | 6 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 42 |
15 files changed, 117 insertions, 117 deletions
diff --git a/include/linux/ip.h b/include/linux/ip.h index d5b7c907204e..31e7cedd9f84 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
@@ -109,7 +109,7 @@ struct ip_options { | |||
109 | #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) | 109 | #define optlength(opt) (sizeof(struct ip_options) + opt->optlen) |
110 | 110 | ||
111 | struct inet_request_sock { | 111 | struct inet_request_sock { |
112 | struct open_request req; | 112 | struct request_sock req; |
113 | u32 loc_addr; | 113 | u32 loc_addr; |
114 | u32 rmt_addr; | 114 | u32 rmt_addr; |
115 | u16 rmt_port; | 115 | u16 rmt_port; |
@@ -123,7 +123,7 @@ struct inet_request_sock { | |||
123 | struct ip_options *opt; | 123 | struct ip_options *opt; |
124 | }; | 124 | }; |
125 | 125 | ||
126 | static inline struct inet_request_sock *inet_rsk(const struct open_request *sk) | 126 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) |
127 | { | 127 | { |
128 | return (struct inet_request_sock *)sk; | 128 | return (struct inet_request_sock *)sk; |
129 | } | 129 | } |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 98acdbf3d446..6fcd6a0ade24 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -201,7 +201,7 @@ struct tcp6_request_sock { | |||
201 | int iif; | 201 | int iif; |
202 | }; | 202 | }; |
203 | 203 | ||
204 | static inline struct tcp6_request_sock *tcp6_rsk(const struct open_request *sk) | 204 | static inline struct tcp6_request_sock *tcp6_rsk(const struct request_sock *sk) |
205 | { | 205 | { |
206 | return (struct tcp6_request_sock *)sk; | 206 | return (struct tcp6_request_sock *)sk; |
207 | } | 207 | } |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 86771b37b80d..fb54292a15aa 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -236,7 +236,7 @@ struct tcp_request_sock { | |||
236 | __u32 snt_isn; | 236 | __u32 snt_isn; |
237 | }; | 237 | }; |
238 | 238 | ||
239 | static inline struct tcp_request_sock *tcp_rsk(const struct open_request *req) | 239 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) |
240 | { | 240 | { |
241 | return (struct tcp_request_sock *)req; | 241 | return (struct tcp_request_sock *)req; |
242 | } | 242 | } |
@@ -393,8 +393,8 @@ struct tcp_sock { | |||
393 | struct tcp_listen_opt *listen_opt; | 393 | struct tcp_listen_opt *listen_opt; |
394 | 394 | ||
395 | /* FIFO of established children */ | 395 | /* FIFO of established children */ |
396 | struct open_request *accept_queue; | 396 | struct request_sock *accept_queue; |
397 | struct open_request *accept_queue_tail; | 397 | struct request_sock *accept_queue_tail; |
398 | 398 | ||
399 | unsigned int keepalive_time; /* time before keep alive takes place */ | 399 | unsigned int keepalive_time; /* time before keep alive takes place */ |
400 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 400 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index 9502f5587931..08a8fd1d1610 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
@@ -19,28 +19,28 @@ | |||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <net/sock.h> | 20 | #include <net/sock.h> |
21 | 21 | ||
22 | struct open_request; | 22 | struct request_sock; |
23 | struct sk_buff; | 23 | struct sk_buff; |
24 | struct dst_entry; | 24 | struct dst_entry; |
25 | struct proto; | 25 | struct proto; |
26 | 26 | ||
27 | struct or_calltable { | 27 | struct request_sock_ops { |
28 | int family; | 28 | int family; |
29 | kmem_cache_t *slab; | 29 | kmem_cache_t *slab; |
30 | int obj_size; | 30 | int obj_size; |
31 | int (*rtx_syn_ack)(struct sock *sk, | 31 | int (*rtx_syn_ack)(struct sock *sk, |
32 | struct open_request *req, | 32 | struct request_sock *req, |
33 | struct dst_entry *dst); | 33 | struct dst_entry *dst); |
34 | void (*send_ack)(struct sk_buff *skb, | 34 | void (*send_ack)(struct sk_buff *skb, |
35 | struct open_request *req); | 35 | struct request_sock *req); |
36 | void (*send_reset)(struct sk_buff *skb); | 36 | void (*send_reset)(struct sk_buff *skb); |
37 | void (*destructor)(struct open_request *req); | 37 | void (*destructor)(struct request_sock *req); |
38 | }; | 38 | }; |
39 | 39 | ||
40 | /* struct open_request - mini sock to represent a connection request | 40 | /* struct request_sock - mini sock to represent a connection request |
41 | */ | 41 | */ |
42 | struct open_request { | 42 | struct request_sock { |
43 | struct open_request *dl_next; /* Must be first member! */ | 43 | struct request_sock *dl_next; /* Must be first member! */ |
44 | u16 mss; | 44 | u16 mss; |
45 | u8 retrans; | 45 | u8 retrans; |
46 | u8 __pad; | 46 | u8 __pad; |
@@ -49,29 +49,29 @@ struct open_request { | |||
49 | u32 rcv_wnd; /* rcv_wnd offered first time */ | 49 | u32 rcv_wnd; /* rcv_wnd offered first time */ |
50 | u32 ts_recent; | 50 | u32 ts_recent; |
51 | unsigned long expires; | 51 | unsigned long expires; |
52 | struct or_calltable *class; | 52 | struct request_sock_ops *rsk_ops; |
53 | struct sock *sk; | 53 | struct sock *sk; |
54 | }; | 54 | }; |
55 | 55 | ||
56 | static inline struct open_request *tcp_openreq_alloc(struct or_calltable *class) | 56 | static inline struct request_sock *reqsk_alloc(struct request_sock_ops *ops) |
57 | { | 57 | { |
58 | struct open_request *req = kmem_cache_alloc(class->slab, SLAB_ATOMIC); | 58 | struct request_sock *req = kmem_cache_alloc(ops->slab, SLAB_ATOMIC); |
59 | 59 | ||
60 | if (req != NULL) | 60 | if (req != NULL) |
61 | req->class = class; | 61 | req->rsk_ops = ops; |
62 | 62 | ||
63 | return req; | 63 | return req; |
64 | } | 64 | } |
65 | 65 | ||
66 | static inline void tcp_openreq_fastfree(struct open_request *req) | 66 | static inline void __reqsk_free(struct request_sock *req) |
67 | { | 67 | { |
68 | kmem_cache_free(req->class->slab, req); | 68 | kmem_cache_free(req->rsk_ops->slab, req); |
69 | } | 69 | } |
70 | 70 | ||
71 | static inline void tcp_openreq_free(struct open_request *req) | 71 | static inline void reqsk_free(struct request_sock *req) |
72 | { | 72 | { |
73 | req->class->destructor(req); | 73 | req->rsk_ops->destructor(req); |
74 | tcp_openreq_fastfree(req); | 74 | __reqsk_free(req); |
75 | } | 75 | } |
76 | 76 | ||
77 | #endif /* _REQUEST_SOCK_H */ | 77 | #endif /* _REQUEST_SOCK_H */ |
diff --git a/include/net/sock.h b/include/net/sock.h index 6919276af8af..e593af5b1ecc 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -484,7 +484,7 @@ extern void sk_stream_kill_queues(struct sock *sk); | |||
484 | 484 | ||
485 | extern int sk_wait_data(struct sock *sk, long *timeo); | 485 | extern int sk_wait_data(struct sock *sk, long *timeo); |
486 | 486 | ||
487 | struct or_calltable; | 487 | struct request_sock_ops; |
488 | 488 | ||
489 | /* Networking protocol blocks we attach to sockets. | 489 | /* Networking protocol blocks we attach to sockets. |
490 | * socket layer -> transport layer interface | 490 | * socket layer -> transport layer interface |
@@ -549,7 +549,7 @@ struct proto { | |||
549 | kmem_cache_t *slab; | 549 | kmem_cache_t *slab; |
550 | unsigned int obj_size; | 550 | unsigned int obj_size; |
551 | 551 | ||
552 | struct or_calltable *rsk_prot; | 552 | struct request_sock_ops *rsk_prot; |
553 | 553 | ||
554 | struct module *owner; | 554 | struct module *owner; |
555 | 555 | ||
diff --git a/include/net/tcp.h b/include/net/tcp.h index d438ba566b89..6663086a5e35 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -641,7 +641,7 @@ struct tcp_func { | |||
641 | 641 | ||
642 | struct sock * (*syn_recv_sock) (struct sock *sk, | 642 | struct sock * (*syn_recv_sock) (struct sock *sk, |
643 | struct sk_buff *skb, | 643 | struct sk_buff *skb, |
644 | struct open_request *req, | 644 | struct request_sock *req, |
645 | struct dst_entry *dst); | 645 | struct dst_entry *dst); |
646 | 646 | ||
647 | int (*remember_stamp) (struct sock *sk); | 647 | int (*remember_stamp) (struct sock *sk); |
@@ -785,8 +785,8 @@ extern enum tcp_tw_status tcp_timewait_state_process(struct tcp_tw_bucket *tw, | |||
785 | unsigned len); | 785 | unsigned len); |
786 | 786 | ||
787 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, | 787 | extern struct sock * tcp_check_req(struct sock *sk,struct sk_buff *skb, |
788 | struct open_request *req, | 788 | struct request_sock *req, |
789 | struct open_request **prev); | 789 | struct request_sock **prev); |
790 | extern int tcp_child_process(struct sock *parent, | 790 | extern int tcp_child_process(struct sock *parent, |
791 | struct sock *child, | 791 | struct sock *child, |
792 | struct sk_buff *skb); | 792 | struct sk_buff *skb); |
@@ -836,12 +836,12 @@ extern int tcp_v4_conn_request(struct sock *sk, | |||
836 | struct sk_buff *skb); | 836 | struct sk_buff *skb); |
837 | 837 | ||
838 | extern struct sock * tcp_create_openreq_child(struct sock *sk, | 838 | extern struct sock * tcp_create_openreq_child(struct sock *sk, |
839 | struct open_request *req, | 839 | struct request_sock *req, |
840 | struct sk_buff *skb); | 840 | struct sk_buff *skb); |
841 | 841 | ||
842 | extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, | 842 | extern struct sock * tcp_v4_syn_recv_sock(struct sock *sk, |
843 | struct sk_buff *skb, | 843 | struct sk_buff *skb, |
844 | struct open_request *req, | 844 | struct request_sock *req, |
845 | struct dst_entry *dst); | 845 | struct dst_entry *dst); |
846 | 846 | ||
847 | extern int tcp_v4_do_rcv(struct sock *sk, | 847 | extern int tcp_v4_do_rcv(struct sock *sk, |
@@ -855,7 +855,7 @@ extern int tcp_connect(struct sock *sk); | |||
855 | 855 | ||
856 | extern struct sk_buff * tcp_make_synack(struct sock *sk, | 856 | extern struct sk_buff * tcp_make_synack(struct sock *sk, |
857 | struct dst_entry *dst, | 857 | struct dst_entry *dst, |
858 | struct open_request *req); | 858 | struct request_sock *req); |
859 | 859 | ||
860 | extern int tcp_disconnect(struct sock *sk, int flags); | 860 | extern int tcp_disconnect(struct sock *sk, int flags); |
861 | 861 | ||
@@ -1683,7 +1683,7 @@ static inline int tcp_full_space(const struct sock *sk) | |||
1683 | return tcp_win_from_space(sk->sk_rcvbuf); | 1683 | return tcp_win_from_space(sk->sk_rcvbuf); |
1684 | } | 1684 | } |
1685 | 1685 | ||
1686 | static inline void tcp_acceptq_queue(struct sock *sk, struct open_request *req, | 1686 | static inline void tcp_acceptq_queue(struct sock *sk, struct request_sock *req, |
1687 | struct sock *child) | 1687 | struct sock *child) |
1688 | { | 1688 | { |
1689 | struct tcp_sock *tp = tcp_sk(sk); | 1689 | struct tcp_sock *tp = tcp_sk(sk); |
@@ -1707,11 +1707,11 @@ struct tcp_listen_opt | |||
1707 | int qlen_young; | 1707 | int qlen_young; |
1708 | int clock_hand; | 1708 | int clock_hand; |
1709 | u32 hash_rnd; | 1709 | u32 hash_rnd; |
1710 | struct open_request *syn_table[TCP_SYNQ_HSIZE]; | 1710 | struct request_sock *syn_table[TCP_SYNQ_HSIZE]; |
1711 | }; | 1711 | }; |
1712 | 1712 | ||
1713 | static inline void | 1713 | static inline void |
1714 | tcp_synq_removed(struct sock *sk, struct open_request *req) | 1714 | tcp_synq_removed(struct sock *sk, struct request_sock *req) |
1715 | { | 1715 | { |
1716 | struct tcp_listen_opt *lopt = tcp_sk(sk)->listen_opt; | 1716 | struct tcp_listen_opt *lopt = tcp_sk(sk)->listen_opt; |
1717 | 1717 | ||
@@ -1745,23 +1745,23 @@ static inline int tcp_synq_is_full(struct sock *sk) | |||
1745 | return tcp_synq_len(sk) >> tcp_sk(sk)->listen_opt->max_qlen_log; | 1745 | return tcp_synq_len(sk) >> tcp_sk(sk)->listen_opt->max_qlen_log; |
1746 | } | 1746 | } |
1747 | 1747 | ||
1748 | static inline void tcp_synq_unlink(struct tcp_sock *tp, struct open_request *req, | 1748 | static inline void tcp_synq_unlink(struct tcp_sock *tp, struct request_sock *req, |
1749 | struct open_request **prev) | 1749 | struct request_sock **prev) |
1750 | { | 1750 | { |
1751 | write_lock(&tp->syn_wait_lock); | 1751 | write_lock(&tp->syn_wait_lock); |
1752 | *prev = req->dl_next; | 1752 | *prev = req->dl_next; |
1753 | write_unlock(&tp->syn_wait_lock); | 1753 | write_unlock(&tp->syn_wait_lock); |
1754 | } | 1754 | } |
1755 | 1755 | ||
1756 | static inline void tcp_synq_drop(struct sock *sk, struct open_request *req, | 1756 | static inline void tcp_synq_drop(struct sock *sk, struct request_sock *req, |
1757 | struct open_request **prev) | 1757 | struct request_sock **prev) |
1758 | { | 1758 | { |
1759 | tcp_synq_unlink(tcp_sk(sk), req, prev); | 1759 | tcp_synq_unlink(tcp_sk(sk), req, prev); |
1760 | tcp_synq_removed(sk, req); | 1760 | tcp_synq_removed(sk, req); |
1761 | tcp_openreq_free(req); | 1761 | reqsk_free(req); |
1762 | } | 1762 | } |
1763 | 1763 | ||
1764 | static __inline__ void tcp_openreq_init(struct open_request *req, | 1764 | static __inline__ void tcp_openreq_init(struct request_sock *req, |
1765 | struct tcp_options_received *rx_opt, | 1765 | struct tcp_options_received *rx_opt, |
1766 | struct sk_buff *skb) | 1766 | struct sk_buff *skb) |
1767 | { | 1767 | { |
diff --git a/include/net/tcp_ecn.h b/include/net/tcp_ecn.h index 94ad970e844a..64980ee8c92a 100644 --- a/include/net/tcp_ecn.h +++ b/include/net/tcp_ecn.h | |||
@@ -39,7 +39,7 @@ static inline void TCP_ECN_send_syn(struct sock *sk, struct tcp_sock *tp, | |||
39 | } | 39 | } |
40 | 40 | ||
41 | static __inline__ void | 41 | static __inline__ void |
42 | TCP_ECN_make_synack(struct open_request *req, struct tcphdr *th) | 42 | TCP_ECN_make_synack(struct request_sock *req, struct tcphdr *th) |
43 | { | 43 | { |
44 | if (inet_rsk(req)->ecn_ok) | 44 | if (inet_rsk(req)->ecn_ok) |
45 | th->ece = 1; | 45 | th->ece = 1; |
@@ -112,13 +112,13 @@ static inline int TCP_ECN_rcv_ecn_echo(struct tcp_sock *tp, struct tcphdr *th) | |||
112 | } | 112 | } |
113 | 113 | ||
114 | static inline void TCP_ECN_openreq_child(struct tcp_sock *tp, | 114 | static inline void TCP_ECN_openreq_child(struct tcp_sock *tp, |
115 | struct open_request *req) | 115 | struct request_sock *req) |
116 | { | 116 | { |
117 | tp->ecn_flags = inet_rsk(req)->ecn_ok ? TCP_ECN_OK : 0; | 117 | tp->ecn_flags = inet_rsk(req)->ecn_ok ? TCP_ECN_OK : 0; |
118 | } | 118 | } |
119 | 119 | ||
120 | static __inline__ void | 120 | static __inline__ void |
121 | TCP_ECN_create_request(struct open_request *req, struct tcphdr *th) | 121 | TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) |
122 | { | 122 | { |
123 | if (sysctl_tcp_ecn && th->ece && th->cwr) | 123 | if (sysctl_tcp_ecn && th->ece && th->cwr) |
124 | inet_rsk(req)->ecn_ok = 1; | 124 | inet_rsk(req)->ecn_ok = 1; |
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 | ||
172 | extern struct or_calltable or_ipv4; | 172 | extern struct request_sock_ops tcp_request_sock_ops; |
173 | 173 | ||
174 | static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb, | 174 | static 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) | |||
1894 | struct sock *tcp_accept(struct sock *sk, int flags, int *err) | 1894 | struct 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 | ||
457 | static int tcpdiag_fill_req(struct sk_buff *skb, struct sock *sk, | 457 | static 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 | ||
872 | static struct open_request *tcp_v4_search_req(struct tcp_sock *tp, | 872 | static 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 | ||
898 | static void tcp_v4_synq_add(struct sock *sk, struct open_request *req) | 898 | static 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 | ||
1259 | static void tcp_v4_or_send_ack(struct sk_buff *skb, struct open_request *req) | 1259 | static 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 | ||
1265 | static struct dst_entry* tcp_v4_route_req(struct sock *sk, | 1265 | static 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 | */ |
1300 | static int tcp_v4_send_synack(struct sock *sk, struct open_request *req, | 1300 | static 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 | */ |
1337 | static void tcp_v4_or_free(struct open_request *req) | 1337 | static 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 | */ |
1358 | static inline struct ip_options *tcp_v4_save_options(struct sock *sk, | 1358 | static 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 | */ |
1390 | int sysctl_max_syn_backlog = 256; | 1390 | int sysctl_max_syn_backlog = 256; |
1391 | 1391 | ||
1392 | struct or_calltable or_ipv4 = { | 1392 | struct 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 | ||
1544 | drop_and_free: | 1544 | drop_and_free: |
1545 | tcp_openreq_free(req); | 1545 | reqsk_free(req); |
1546 | drop: | 1546 | drop: |
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 | */ |
1556 | struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | 1556 | struct 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 | ||
2462 | static void get_openreq4(struct sock *sk, struct open_request *req, | 2462 | static 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 | */ |
687 | struct sock *tcp_create_openreq_child(struct sock *sk, struct open_request *req, struct sk_buff *skb) | 687 | struct 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 | ||
859 | struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb, | 859 | struct 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 | */ |
1358 | struct sk_buff * tcp_make_synack(struct sock *sk, struct dst_entry *dst, | 1358 | struct 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 | ||
67 | static void tcp_v6_send_reset(struct sk_buff *skb); | 67 | static void tcp_v6_send_reset(struct sk_buff *skb); |
68 | static void tcp_v6_or_send_ack(struct sk_buff *skb, struct open_request *req); | 68 | static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req); |
69 | static void tcp_v6_send_check(struct sock *sk, struct tcphdr *th, int len, | 69 | static 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 | ||
397 | static struct open_request *tcp_v6_search_req(struct tcp_sock *tp, | 397 | static 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 | ||
962 | static int tcp_v6_send_synack(struct sock *sk, struct open_request *req, | 962 | static 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 | ||
1030 | static void tcp_v6_or_free(struct open_request *req) | 1030 | static 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 | ||
1036 | static struct or_calltable or_ipv6 = { | 1036 | static 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 | ||
1226 | static void tcp_v6_or_send_ack(struct sk_buff *skb, struct open_request *req) | 1226 | static 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 | ||
1232 | static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) | 1232 | static 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 | ||
1267 | static void tcp_v6_synq_add(struct sock *sk, struct open_request *req) | 1267 | static 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 | ||
1359 | drop: | 1359 | drop: |
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 | ||
1367 | static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | 1367 | static 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. */ |
2057 | static void get_openreq6(struct seq_file *seq, | 2057 | static 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 | ||
2250 | static struct inet6_protocol tcpv6_protocol = { | 2250 | static struct inet6_protocol tcpv6_protocol = { |