diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-12-14 02:15:40 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 16:10:37 -0500 |
commit | ca304b6104ffdd120bb6687a88a0625e58bc71cd (patch) | |
tree | 99bdf631af245808459a0a956350b9388eada7fc /net | |
parent | 8129765ac07c2455c927051e3a8b048b619b56ee (diff) |
[IPV6]: Introduce inet6_rsk()
And inet6_rsk_offset in inet_request_sock, for the same reasons as
inet_sock's pinfo6 member.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/inet_diag.c | 8 | ||||
-rw-r--r-- | net/ipv6/inet6_connection_sock.c | 4 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 19 |
3 files changed, 15 insertions, 16 deletions
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 39061ed53cfd..3ce73b141d7e 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -489,9 +489,9 @@ static int inet_diag_fill_req(struct sk_buff *skb, struct sock *sk, | |||
489 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 489 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) |
490 | if (r->idiag_family == AF_INET6) { | 490 | if (r->idiag_family == AF_INET6) { |
491 | ipv6_addr_copy((struct in6_addr *)r->id.idiag_src, | 491 | ipv6_addr_copy((struct in6_addr *)r->id.idiag_src, |
492 | &tcp6_rsk(req)->loc_addr); | 492 | &inet6_rsk(req)->loc_addr); |
493 | ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst, | 493 | ipv6_addr_copy((struct in6_addr *)r->id.idiag_dst, |
494 | &tcp6_rsk(req)->rmt_addr); | 494 | &inet6_rsk(req)->rmt_addr); |
495 | } | 495 | } |
496 | #endif | 496 | #endif |
497 | nlh->nlmsg_len = skb->tail - b; | 497 | nlh->nlmsg_len = skb->tail - b; |
@@ -553,13 +553,13 @@ static int inet_diag_dump_reqs(struct sk_buff *skb, struct sock *sk, | |||
553 | entry.saddr = | 553 | entry.saddr = |
554 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 554 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) |
555 | (entry.family == AF_INET6) ? | 555 | (entry.family == AF_INET6) ? |
556 | tcp6_rsk(req)->loc_addr.s6_addr32 : | 556 | inet6_rsk(req)->loc_addr.s6_addr32 : |
557 | #endif | 557 | #endif |
558 | &ireq->loc_addr; | 558 | &ireq->loc_addr; |
559 | entry.daddr = | 559 | entry.daddr = |
560 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 560 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) |
561 | (entry.family == AF_INET6) ? | 561 | (entry.family == AF_INET6) ? |
562 | tcp6_rsk(req)->rmt_addr.s6_addr32 : | 562 | inet6_rsk(req)->rmt_addr.s6_addr32 : |
563 | #endif | 563 | #endif |
564 | &ireq->rmt_addr; | 564 | &ireq->rmt_addr; |
565 | entry.dport = ntohs(ireq->rmt_port); | 565 | entry.dport = ntohs(ireq->rmt_port); |
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index 04ff44344f90..fe874eeaa40c 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
@@ -61,7 +61,7 @@ struct request_sock *inet6_csk_search_req(const struct sock *sk, | |||
61 | lopt->nr_table_entries)]; | 61 | lopt->nr_table_entries)]; |
62 | (req = *prev) != NULL; | 62 | (req = *prev) != NULL; |
63 | prev = &req->dl_next) { | 63 | prev = &req->dl_next) { |
64 | const struct tcp6_request_sock *treq = tcp6_rsk(req); | 64 | const struct inet6_request_sock *treq = inet6_rsk(req); |
65 | 65 | ||
66 | if (inet_rsk(req)->rmt_port == rport && | 66 | if (inet_rsk(req)->rmt_port == rport && |
67 | req->rsk_ops->family == AF_INET6 && | 67 | req->rsk_ops->family == AF_INET6 && |
@@ -85,7 +85,7 @@ void inet6_csk_reqsk_queue_hash_add(struct sock *sk, | |||
85 | { | 85 | { |
86 | struct inet_connection_sock *icsk = inet_csk(sk); | 86 | struct inet_connection_sock *icsk = inet_csk(sk); |
87 | struct listen_sock *lopt = icsk->icsk_accept_queue.listen_opt; | 87 | struct listen_sock *lopt = icsk->icsk_accept_queue.listen_opt; |
88 | const u32 h = inet6_synq_hash(&tcp6_rsk(req)->rmt_addr, | 88 | const u32 h = inet6_synq_hash(&inet6_rsk(req)->rmt_addr, |
89 | inet_rsk(req)->rmt_port, | 89 | inet_rsk(req)->rmt_port, |
90 | lopt->hash_rnd, lopt->nr_table_entries); | 90 | lopt->hash_rnd, lopt->nr_table_entries); |
91 | 91 | ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 5a10d30cec4a..c2472d771664 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -656,7 +656,7 @@ out: | |||
656 | static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req, | 656 | static int tcp_v6_send_synack(struct sock *sk, struct request_sock *req, |
657 | struct dst_entry *dst) | 657 | struct dst_entry *dst) |
658 | { | 658 | { |
659 | struct tcp6_request_sock *treq = tcp6_rsk(req); | 659 | struct inet6_request_sock *treq = inet6_rsk(req); |
660 | struct ipv6_pinfo *np = inet6_sk(sk); | 660 | struct ipv6_pinfo *np = inet6_sk(sk); |
661 | struct sk_buff * skb; | 661 | struct sk_buff * skb; |
662 | struct ipv6_txoptions *opt = NULL; | 662 | struct ipv6_txoptions *opt = NULL; |
@@ -722,8 +722,8 @@ done: | |||
722 | 722 | ||
723 | static void tcp_v6_reqsk_destructor(struct request_sock *req) | 723 | static void tcp_v6_reqsk_destructor(struct request_sock *req) |
724 | { | 724 | { |
725 | if (tcp6_rsk(req)->pktopts) | 725 | if (inet6_rsk(req)->pktopts) |
726 | kfree_skb(tcp6_rsk(req)->pktopts); | 726 | kfree_skb(inet6_rsk(req)->pktopts); |
727 | } | 727 | } |
728 | 728 | ||
729 | static struct request_sock_ops tcp6_request_sock_ops = { | 729 | static struct request_sock_ops tcp6_request_sock_ops = { |
@@ -956,7 +956,7 @@ static struct sock *tcp_v6_hnd_req(struct sock *sk,struct sk_buff *skb) | |||
956 | */ | 956 | */ |
957 | static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | 957 | static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) |
958 | { | 958 | { |
959 | struct tcp6_request_sock *treq; | 959 | struct inet6_request_sock *treq; |
960 | struct ipv6_pinfo *np = inet6_sk(sk); | 960 | struct ipv6_pinfo *np = inet6_sk(sk); |
961 | struct tcp_options_received tmp_opt; | 961 | struct tcp_options_received tmp_opt; |
962 | struct tcp_sock *tp = tcp_sk(sk); | 962 | struct tcp_sock *tp = tcp_sk(sk); |
@@ -981,7 +981,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
981 | if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) | 981 | if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) |
982 | goto drop; | 982 | goto drop; |
983 | 983 | ||
984 | req = reqsk_alloc(&tcp6_request_sock_ops); | 984 | req = inet6_reqsk_alloc(&tcp6_request_sock_ops); |
985 | if (req == NULL) | 985 | if (req == NULL) |
986 | goto drop; | 986 | goto drop; |
987 | 987 | ||
@@ -994,7 +994,7 @@ static int tcp_v6_conn_request(struct sock *sk, struct sk_buff *skb) | |||
994 | tmp_opt.tstamp_ok = tmp_opt.saw_tstamp; | 994 | tmp_opt.tstamp_ok = tmp_opt.saw_tstamp; |
995 | tcp_openreq_init(req, &tmp_opt, skb); | 995 | tcp_openreq_init(req, &tmp_opt, skb); |
996 | 996 | ||
997 | treq = tcp6_rsk(req); | 997 | treq = inet6_rsk(req); |
998 | ipv6_addr_copy(&treq->rmt_addr, &skb->nh.ipv6h->saddr); | 998 | ipv6_addr_copy(&treq->rmt_addr, &skb->nh.ipv6h->saddr); |
999 | ipv6_addr_copy(&treq->loc_addr, &skb->nh.ipv6h->daddr); | 999 | ipv6_addr_copy(&treq->loc_addr, &skb->nh.ipv6h->daddr); |
1000 | TCP_ECN_create_request(req, skb->h.th); | 1000 | TCP_ECN_create_request(req, skb->h.th); |
@@ -1035,7 +1035,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1035 | struct request_sock *req, | 1035 | struct request_sock *req, |
1036 | struct dst_entry *dst) | 1036 | struct dst_entry *dst) |
1037 | { | 1037 | { |
1038 | struct tcp6_request_sock *treq = tcp6_rsk(req); | 1038 | struct inet6_request_sock *treq = inet6_rsk(req); |
1039 | struct ipv6_pinfo *newnp, *np = inet6_sk(sk); | 1039 | struct ipv6_pinfo *newnp, *np = inet6_sk(sk); |
1040 | struct tcp6_sock *newtcp6sk; | 1040 | struct tcp6_sock *newtcp6sk; |
1041 | struct inet_sock *newinet; | 1041 | struct inet_sock *newinet; |
@@ -1723,14 +1723,13 @@ static int tcp_v6_destroy_sock(struct sock *sk) | |||
1723 | static void get_openreq6(struct seq_file *seq, | 1723 | static void get_openreq6(struct seq_file *seq, |
1724 | struct sock *sk, struct request_sock *req, int i, int uid) | 1724 | struct sock *sk, struct request_sock *req, int i, int uid) |
1725 | { | 1725 | { |
1726 | struct in6_addr *dest, *src; | ||
1727 | int ttd = req->expires - jiffies; | 1726 | int ttd = req->expires - jiffies; |
1727 | struct in6_addr *src = &inet6_rsk(req)->loc_addr; | ||
1728 | struct in6_addr *dest = &inet6_rsk(req)->rmt_addr; | ||
1728 | 1729 | ||
1729 | if (ttd < 0) | 1730 | if (ttd < 0) |
1730 | ttd = 0; | 1731 | ttd = 0; |
1731 | 1732 | ||
1732 | src = &tcp6_rsk(req)->loc_addr; | ||
1733 | dest = &tcp6_rsk(req)->rmt_addr; | ||
1734 | seq_printf(seq, | 1733 | seq_printf(seq, |
1735 | "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X " | 1734 | "%4d: %08X%08X%08X%08X:%04X %08X%08X%08X%08X:%04X " |
1736 | "%02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p\n", | 1735 | "%02X %08X:%08X %02X:%08lX %08X %5d %8d %d %d %p\n", |