diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-12-14 02:15:52 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 16:10:38 -0500 |
commit | 8292a17a399ffb7c5c8b083db4ad994e090055f7 (patch) | |
tree | 1544436169ba1dc2eface34664a203c2c17a8d65 /net/ipv6 | |
parent | ca304b6104ffdd120bb6687a88a0625e58bc71cd (diff) |
[ICSK]: Rename struct tcp_func to struct inet_connection_sock_af_ops
And move it to struct inet_connection_sock. DCCP will use it in the
upcoming changesets.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv6')
-rw-r--r-- | net/ipv6/ipv6_sockglue.c | 2 | ||||
-rw-r--r-- | net/ipv6/tcp_ipv6.c | 28 |
2 files changed, 14 insertions, 16 deletions
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 3620718defe6..b6b63fa8454c 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -170,7 +170,7 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, | |||
170 | sock_prot_inc_use(&tcp_prot); | 170 | sock_prot_inc_use(&tcp_prot); |
171 | local_bh_enable(); | 171 | local_bh_enable(); |
172 | sk->sk_prot = &tcp_prot; | 172 | sk->sk_prot = &tcp_prot; |
173 | tp->af_specific = &ipv4_specific; | 173 | inet_csk(sk)->icsk_af_ops = &ipv4_specific; |
174 | sk->sk_socket->ops = &inet_stream_ops; | 174 | sk->sk_socket->ops = &inet_stream_ops; |
175 | sk->sk_family = PF_INET; | 175 | sk->sk_family = PF_INET; |
176 | tcp_sync_mss(sk, tp->pmtu_cookie); | 176 | tcp_sync_mss(sk, tp->pmtu_cookie); |
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index c2472d771664..8ce8a1359d2b 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -68,14 +68,14 @@ | |||
68 | 68 | ||
69 | static void tcp_v6_send_reset(struct sk_buff *skb); | 69 | static void tcp_v6_send_reset(struct sk_buff *skb); |
70 | static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req); | 70 | static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req); |
71 | static void tcp_v6_send_check(struct sock *sk, struct tcphdr *th, int len, | 71 | static void tcp_v6_send_check(struct sock *sk, int len, |
72 | struct sk_buff *skb); | 72 | struct sk_buff *skb); |
73 | 73 | ||
74 | static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb); | 74 | static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb); |
75 | static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok); | 75 | static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok); |
76 | 76 | ||
77 | static struct tcp_func ipv6_mapped; | 77 | static struct inet_connection_sock_af_ops ipv6_mapped; |
78 | static struct tcp_func ipv6_specific; | 78 | static struct inet_connection_sock_af_ops ipv6_specific; |
79 | 79 | ||
80 | int inet6_csk_bind_conflict(const struct sock *sk, | 80 | int inet6_csk_bind_conflict(const struct sock *sk, |
81 | const struct inet_bind_bucket *tb) | 81 | const struct inet_bind_bucket *tb) |
@@ -107,9 +107,7 @@ static int tcp_v6_get_port(struct sock *sk, unsigned short snum) | |||
107 | static void tcp_v6_hash(struct sock *sk) | 107 | static void tcp_v6_hash(struct sock *sk) |
108 | { | 108 | { |
109 | if (sk->sk_state != TCP_CLOSE) { | 109 | if (sk->sk_state != TCP_CLOSE) { |
110 | struct tcp_sock *tp = tcp_sk(sk); | 110 | if (inet_csk(sk)->icsk_af_ops == &ipv6_mapped) { |
111 | |||
112 | if (tp->af_specific == &ipv6_mapped) { | ||
113 | tcp_prot.hash(sk); | 111 | tcp_prot.hash(sk); |
114 | return; | 112 | return; |
115 | } | 113 | } |
@@ -417,14 +415,14 @@ static int tcp_v6_connect(struct sock *sk, struct sockaddr *uaddr, | |||
417 | sin.sin_port = usin->sin6_port; | 415 | sin.sin_port = usin->sin6_port; |
418 | sin.sin_addr.s_addr = usin->sin6_addr.s6_addr32[3]; | 416 | sin.sin_addr.s_addr = usin->sin6_addr.s6_addr32[3]; |
419 | 417 | ||
420 | tp->af_specific = &ipv6_mapped; | 418 | inet_csk(sk)->icsk_af_ops = &ipv6_mapped; |
421 | sk->sk_backlog_rcv = tcp_v4_do_rcv; | 419 | sk->sk_backlog_rcv = tcp_v4_do_rcv; |
422 | 420 | ||
423 | err = tcp_v4_connect(sk, (struct sockaddr *)&sin, sizeof(sin)); | 421 | err = tcp_v4_connect(sk, (struct sockaddr *)&sin, sizeof(sin)); |
424 | 422 | ||
425 | if (err) { | 423 | if (err) { |
426 | tp->ext_header_len = exthdrlen; | 424 | tp->ext_header_len = exthdrlen; |
427 | tp->af_specific = &ipv6_specific; | 425 | inet_csk(sk)->icsk_af_ops = &ipv6_specific; |
428 | sk->sk_backlog_rcv = tcp_v6_do_rcv; | 426 | sk->sk_backlog_rcv = tcp_v6_do_rcv; |
429 | goto failure; | 427 | goto failure; |
430 | } else { | 428 | } else { |
@@ -751,10 +749,10 @@ static int ipv6_opt_accepted(struct sock *sk, struct sk_buff *skb) | |||
751 | } | 749 | } |
752 | 750 | ||
753 | 751 | ||
754 | static void tcp_v6_send_check(struct sock *sk, struct tcphdr *th, int len, | 752 | static void tcp_v6_send_check(struct sock *sk, int len, struct sk_buff *skb) |
755 | struct sk_buff *skb) | ||
756 | { | 753 | { |
757 | struct ipv6_pinfo *np = inet6_sk(sk); | 754 | struct ipv6_pinfo *np = inet6_sk(sk); |
755 | struct tcphdr *th = skb->h.th; | ||
758 | 756 | ||
759 | if (skb->ip_summed == CHECKSUM_HW) { | 757 | if (skb->ip_summed == CHECKSUM_HW) { |
760 | th->check = ~csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, 0); | 758 | th->check = ~csum_ipv6_magic(&np->saddr, &np->daddr, len, IPPROTO_TCP, 0); |
@@ -1070,7 +1068,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1070 | 1068 | ||
1071 | ipv6_addr_copy(&newnp->rcv_saddr, &newnp->saddr); | 1069 | ipv6_addr_copy(&newnp->rcv_saddr, &newnp->saddr); |
1072 | 1070 | ||
1073 | newtp->af_specific = &ipv6_mapped; | 1071 | inet_csk(newsk)->icsk_af_ops = &ipv6_mapped; |
1074 | newsk->sk_backlog_rcv = tcp_v4_do_rcv; | 1072 | newsk->sk_backlog_rcv = tcp_v4_do_rcv; |
1075 | newnp->pktoptions = NULL; | 1073 | newnp->pktoptions = NULL; |
1076 | newnp->opt = NULL; | 1074 | newnp->opt = NULL; |
@@ -1084,7 +1082,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1084 | */ | 1082 | */ |
1085 | 1083 | ||
1086 | /* It is tricky place. Until this moment IPv4 tcp | 1084 | /* It is tricky place. Until this moment IPv4 tcp |
1087 | worked with IPv6 af_tcp.af_specific. | 1085 | worked with IPv6 icsk.icsk_af_ops. |
1088 | Sync it now. | 1086 | Sync it now. |
1089 | */ | 1087 | */ |
1090 | tcp_sync_mss(newsk, newtp->pmtu_cookie); | 1088 | tcp_sync_mss(newsk, newtp->pmtu_cookie); |
@@ -1631,7 +1629,7 @@ static int tcp_v6_remember_stamp(struct sock *sk) | |||
1631 | return 0; | 1629 | return 0; |
1632 | } | 1630 | } |
1633 | 1631 | ||
1634 | static struct tcp_func ipv6_specific = { | 1632 | static struct inet_connection_sock_af_ops ipv6_specific = { |
1635 | .queue_xmit = tcp_v6_xmit, | 1633 | .queue_xmit = tcp_v6_xmit, |
1636 | .send_check = tcp_v6_send_check, | 1634 | .send_check = tcp_v6_send_check, |
1637 | .rebuild_header = tcp_v6_rebuild_header, | 1635 | .rebuild_header = tcp_v6_rebuild_header, |
@@ -1650,7 +1648,7 @@ static struct tcp_func ipv6_specific = { | |||
1650 | * TCP over IPv4 via INET6 API | 1648 | * TCP over IPv4 via INET6 API |
1651 | */ | 1649 | */ |
1652 | 1650 | ||
1653 | static struct tcp_func ipv6_mapped = { | 1651 | static struct inet_connection_sock_af_ops ipv6_mapped = { |
1654 | .queue_xmit = ip_queue_xmit, | 1652 | .queue_xmit = ip_queue_xmit, |
1655 | .send_check = tcp_v4_send_check, | 1653 | .send_check = tcp_v4_send_check, |
1656 | .rebuild_header = inet_sk_rebuild_header, | 1654 | .rebuild_header = inet_sk_rebuild_header, |
@@ -1700,7 +1698,7 @@ static int tcp_v6_init_sock(struct sock *sk) | |||
1700 | 1698 | ||
1701 | sk->sk_state = TCP_CLOSE; | 1699 | sk->sk_state = TCP_CLOSE; |
1702 | 1700 | ||
1703 | tp->af_specific = &ipv6_specific; | 1701 | icsk->icsk_af_ops = &ipv6_specific; |
1704 | icsk->icsk_ca_ops = &tcp_init_congestion_ops; | 1702 | icsk->icsk_ca_ops = &tcp_init_congestion_ops; |
1705 | sk->sk_write_space = sk_stream_write_space; | 1703 | sk->sk_write_space = sk_stream_write_space; |
1706 | sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); | 1704 | sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); |