aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6/tcp_ipv6.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/tcp_ipv6.c')
-rw-r--r--net/ipv6/tcp_ipv6.c42
1 files changed, 21 insertions, 21 deletions
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 = {