aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-12-14 02:15:52 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 16:10:38 -0500
commit8292a17a399ffb7c5c8b083db4ad994e090055f7 (patch)
tree1544436169ba1dc2eface34664a203c2c17a8d65 /net
parentca304b6104ffdd120bb6687a88a0625e58bc71cd (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')
-rw-r--r--net/ipv4/syncookies.c4
-rw-r--r--net/ipv4/tcp.c8
-rw-r--r--net/ipv4/tcp_input.c11
-rw-r--r--net/ipv4/tcp_ipv4.c11
-rw-r--r--net/ipv4/tcp_minisocks.c8
-rw-r--r--net/ipv4/tcp_output.c17
-rw-r--r--net/ipv6/ipv6_sockglue.c2
-rw-r--r--net/ipv6/tcp_ipv6.c28
8 files changed, 43 insertions, 46 deletions
diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
index a34e60ea48a1..e20be3331f67 100644
--- a/net/ipv4/syncookies.c
+++ b/net/ipv4/syncookies.c
@@ -173,10 +173,10 @@ static inline struct sock *get_cookie_sock(struct sock *sk, struct sk_buff *skb,
173 struct request_sock *req, 173 struct request_sock *req,
174 struct dst_entry *dst) 174 struct dst_entry *dst)
175{ 175{
176 struct tcp_sock *tp = tcp_sk(sk); 176 struct inet_connection_sock *icsk = inet_csk(sk);
177 struct sock *child; 177 struct sock *child;
178 178
179 child = tp->af_specific->syn_recv_sock(sk, skb, req, dst); 179 child = icsk->icsk_af_ops->syn_recv_sock(sk, skb, req, dst);
180 if (child) 180 if (child)
181 inet_csk_reqsk_queue_add(sk, req, child); 181 inet_csk_reqsk_queue_add(sk, req, child);
182 else 182 else
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index ef98b14ac56d..eacfe6a3442c 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1696,8 +1696,8 @@ int tcp_setsockopt(struct sock *sk, int level, int optname, char __user *optval,
1696 int err = 0; 1696 int err = 0;
1697 1697
1698 if (level != SOL_TCP) 1698 if (level != SOL_TCP)
1699 return tp->af_specific->setsockopt(sk, level, optname, 1699 return icsk->icsk_af_ops->setsockopt(sk, level, optname,
1700 optval, optlen); 1700 optval, optlen);
1701 1701
1702 /* This is a string value all the others are int's */ 1702 /* This is a string value all the others are int's */
1703 if (optname == TCP_CONGESTION) { 1703 if (optname == TCP_CONGESTION) {
@@ -1939,8 +1939,8 @@ int tcp_getsockopt(struct sock *sk, int level, int optname, char __user *optval,
1939 int val, len; 1939 int val, len;
1940 1940
1941 if (level != SOL_TCP) 1941 if (level != SOL_TCP)
1942 return tp->af_specific->getsockopt(sk, level, optname, 1942 return icsk->icsk_af_ops->getsockopt(sk, level, optname,
1943 optval, optlen); 1943 optval, optlen);
1944 1944
1945 if (get_user(len, optlen)) 1945 if (get_user(len, optlen))
1946 return -EFAULT; 1946 return -EFAULT;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index bf2e23086bce..7de6184d4bd8 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4071,8 +4071,10 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
4071 mb(); 4071 mb();
4072 tcp_set_state(sk, TCP_ESTABLISHED); 4072 tcp_set_state(sk, TCP_ESTABLISHED);
4073 4073
4074 icsk = inet_csk(sk);
4075
4074 /* Make sure socket is routed, for correct metrics. */ 4076 /* Make sure socket is routed, for correct metrics. */
4075 tp->af_specific->rebuild_header(sk); 4077 icsk->icsk_af_ops->rebuild_header(sk);
4076 4078
4077 tcp_init_metrics(sk); 4079 tcp_init_metrics(sk);
4078 4080
@@ -4098,8 +4100,6 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb,
4098 sk_wake_async(sk, 0, POLL_OUT); 4100 sk_wake_async(sk, 0, POLL_OUT);
4099 } 4101 }
4100 4102
4101 icsk = inet_csk(sk);
4102
4103 if (sk->sk_write_pending || 4103 if (sk->sk_write_pending ||
4104 icsk->icsk_accept_queue.rskq_defer_accept || 4104 icsk->icsk_accept_queue.rskq_defer_accept ||
4105 icsk->icsk_ack.pingpong) { 4105 icsk->icsk_ack.pingpong) {
@@ -4220,6 +4220,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
4220 struct tcphdr *th, unsigned len) 4220 struct tcphdr *th, unsigned len)
4221{ 4221{
4222 struct tcp_sock *tp = tcp_sk(sk); 4222 struct tcp_sock *tp = tcp_sk(sk);
4223 struct inet_connection_sock *icsk = inet_csk(sk);
4223 int queued = 0; 4224 int queued = 0;
4224 4225
4225 tp->rx_opt.saw_tstamp = 0; 4226 tp->rx_opt.saw_tstamp = 0;
@@ -4236,7 +4237,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
4236 goto discard; 4237 goto discard;
4237 4238
4238 if(th->syn) { 4239 if(th->syn) {
4239 if(tp->af_specific->conn_request(sk, skb) < 0) 4240 if (icsk->icsk_af_ops->conn_request(sk, skb) < 0)
4240 return 1; 4241 return 1;
4241 4242
4242 /* Now we have several options: In theory there is 4243 /* Now we have several options: In theory there is
@@ -4349,7 +4350,7 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
4349 /* Make sure socket is routed, for 4350 /* Make sure socket is routed, for
4350 * correct metrics. 4351 * correct metrics.
4351 */ 4352 */
4352 tp->af_specific->rebuild_header(sk); 4353 icsk->icsk_af_ops->rebuild_header(sk);
4353 4354
4354 tcp_init_metrics(sk); 4355 tcp_init_metrics(sk);
4355 4356
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index 2aa19c89a94a..704cf2105795 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -86,8 +86,7 @@ int sysctl_tcp_low_latency;
86/* Socket used for sending RSTs */ 86/* Socket used for sending RSTs */
87static struct socket *tcp_socket; 87static struct socket *tcp_socket;
88 88
89void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len, 89void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb);
90 struct sk_buff *skb);
91 90
92struct inet_hashinfo __cacheline_aligned tcp_hashinfo = { 91struct inet_hashinfo __cacheline_aligned tcp_hashinfo = {
93 .lhash_lock = RW_LOCK_UNLOCKED, 92 .lhash_lock = RW_LOCK_UNLOCKED,
@@ -645,10 +644,10 @@ out:
645} 644}
646 645
647/* This routine computes an IPv4 TCP checksum. */ 646/* This routine computes an IPv4 TCP checksum. */
648void tcp_v4_send_check(struct sock *sk, struct tcphdr *th, int len, 647void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb)
649 struct sk_buff *skb)
650{ 648{
651 struct inet_sock *inet = inet_sk(sk); 649 struct inet_sock *inet = inet_sk(sk);
650 struct tcphdr *th = skb->h.th;
652 651
653 if (skb->ip_summed == CHECKSUM_HW) { 652 if (skb->ip_summed == CHECKSUM_HW) {
654 th->check = ~tcp_v4_check(th, len, inet->saddr, inet->daddr, 0); 653 th->check = ~tcp_v4_check(th, len, inet->saddr, inet->daddr, 0);
@@ -1383,7 +1382,7 @@ int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw)
1383 return 0; 1382 return 0;
1384} 1383}
1385 1384
1386struct tcp_func ipv4_specific = { 1385struct inet_connection_sock_af_ops ipv4_specific = {
1387 .queue_xmit = ip_queue_xmit, 1386 .queue_xmit = ip_queue_xmit,
1388 .send_check = tcp_v4_send_check, 1387 .send_check = tcp_v4_send_check,
1389 .rebuild_header = inet_sk_rebuild_header, 1388 .rebuild_header = inet_sk_rebuild_header,
@@ -1434,7 +1433,7 @@ static int tcp_v4_init_sock(struct sock *sk)
1434 sk->sk_write_space = sk_stream_write_space; 1433 sk->sk_write_space = sk_stream_write_space;
1435 sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); 1434 sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
1436 1435
1437 tp->af_specific = &ipv4_specific; 1436 icsk->icsk_af_ops = &ipv4_specific;
1438 1437
1439 sk->sk_sndbuf = sysctl_tcp_wmem[1]; 1438 sk->sk_sndbuf = sysctl_tcp_wmem[1];
1440 sk->sk_rcvbuf = sysctl_tcp_rmem[1]; 1439 sk->sk_rcvbuf = sysctl_tcp_rmem[1];
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
index 1b66a2ac4321..9c029683a626 100644
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
@@ -274,18 +274,18 @@ kill:
274void tcp_time_wait(struct sock *sk, int state, int timeo) 274void tcp_time_wait(struct sock *sk, int state, int timeo)
275{ 275{
276 struct inet_timewait_sock *tw = NULL; 276 struct inet_timewait_sock *tw = NULL;
277 const struct inet_connection_sock *icsk = inet_csk(sk);
277 const struct tcp_sock *tp = tcp_sk(sk); 278 const struct tcp_sock *tp = tcp_sk(sk);
278 int recycle_ok = 0; 279 int recycle_ok = 0;
279 280
280 if (tcp_death_row.sysctl_tw_recycle && tp->rx_opt.ts_recent_stamp) 281 if (tcp_death_row.sysctl_tw_recycle && tp->rx_opt.ts_recent_stamp)
281 recycle_ok = tp->af_specific->remember_stamp(sk); 282 recycle_ok = icsk->icsk_af_ops->remember_stamp(sk);
282 283
283 if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets) 284 if (tcp_death_row.tw_count < tcp_death_row.sysctl_max_tw_buckets)
284 tw = inet_twsk_alloc(sk, state); 285 tw = inet_twsk_alloc(sk, state);
285 286
286 if (tw != NULL) { 287 if (tw != NULL) {
287 struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw); 288 struct tcp_timewait_sock *tcptw = tcp_twsk((struct sock *)tw);
288 const struct inet_connection_sock *icsk = inet_csk(sk);
289 const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1); 289 const int rto = (icsk->icsk_rto << 2) - (icsk->icsk_rto >> 1);
290 290
291 tw->tw_rcv_wscale = tp->rx_opt.rcv_wscale; 291 tw->tw_rcv_wscale = tp->rx_opt.rcv_wscale;
@@ -456,7 +456,6 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
456 struct request_sock **prev) 456 struct request_sock **prev)
457{ 457{
458 struct tcphdr *th = skb->h.th; 458 struct tcphdr *th = skb->h.th;
459 struct tcp_sock *tp = tcp_sk(sk);
460 u32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK); 459 u32 flg = tcp_flag_word(th) & (TCP_FLAG_RST|TCP_FLAG_SYN|TCP_FLAG_ACK);
461 int paws_reject = 0; 460 int paws_reject = 0;
462 struct tcp_options_received tmp_opt; 461 struct tcp_options_received tmp_opt;
@@ -613,7 +612,8 @@ struct sock *tcp_check_req(struct sock *sk,struct sk_buff *skb,
613 * ESTABLISHED STATE. If it will be dropped after 612 * ESTABLISHED STATE. If it will be dropped after
614 * socket is created, wait for troubles. 613 * socket is created, wait for troubles.
615 */ 614 */
616 child = tp->af_specific->syn_recv_sock(sk, skb, req, NULL); 615 child = inet_csk(sk)->icsk_af_ops->syn_recv_sock(sk, skb,
616 req, NULL);
617 if (child == NULL) 617 if (child == NULL)
618 goto listen_overflow; 618 goto listen_overflow;
619 619
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index b7325e0b406a..af1946c52c37 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -371,7 +371,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
371 TCP_ECN_send(sk, tp, skb, tcp_header_size); 371 TCP_ECN_send(sk, tp, skb, tcp_header_size);
372 } 372 }
373 373
374 tp->af_specific->send_check(sk, th, skb->len, skb); 374 icsk->icsk_af_ops->send_check(sk, skb->len, skb);
375 375
376 if (likely(tcb->flags & TCPCB_FLAG_ACK)) 376 if (likely(tcb->flags & TCPCB_FLAG_ACK))
377 tcp_event_ack_sent(sk, tcp_skb_pcount(skb)); 377 tcp_event_ack_sent(sk, tcp_skb_pcount(skb));
@@ -381,7 +381,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it,
381 381
382 TCP_INC_STATS(TCP_MIB_OUTSEGS); 382 TCP_INC_STATS(TCP_MIB_OUTSEGS);
383 383
384 err = tp->af_specific->queue_xmit(skb, 0); 384 err = icsk->icsk_af_ops->queue_xmit(skb, 0);
385 if (unlikely(err <= 0)) 385 if (unlikely(err <= 0))
386 return err; 386 return err;
387 387
@@ -638,12 +638,11 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len)
638unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu) 638unsigned int tcp_sync_mss(struct sock *sk, u32 pmtu)
639{ 639{
640 struct tcp_sock *tp = tcp_sk(sk); 640 struct tcp_sock *tp = tcp_sk(sk);
641 int mss_now;
642
643 /* Calculate base mss without TCP options: 641 /* Calculate base mss without TCP options:
644 It is MMS_S - sizeof(tcphdr) of rfc1122 642 It is MMS_S - sizeof(tcphdr) of rfc1122
645 */ 643 */
646 mss_now = pmtu - tp->af_specific->net_header_len - sizeof(struct tcphdr); 644 int mss_now = (pmtu - inet_csk(sk)->icsk_af_ops->net_header_len -
645 sizeof(struct tcphdr));
647 646
648 /* Clamp it (mss_clamp does not include tcp options) */ 647 /* Clamp it (mss_clamp does not include tcp options) */
649 if (mss_now > tp->rx_opt.mss_clamp) 648 if (mss_now > tp->rx_opt.mss_clamp)
@@ -705,9 +704,9 @@ unsigned int tcp_current_mss(struct sock *sk, int large_allowed)
705 xmit_size_goal = mss_now; 704 xmit_size_goal = mss_now;
706 705
707 if (doing_tso) { 706 if (doing_tso) {
708 xmit_size_goal = 65535 - 707 xmit_size_goal = (65535 -
709 tp->af_specific->net_header_len - 708 inet_csk(sk)->icsk_af_ops->net_header_len -
710 tp->ext_header_len - tp->tcp_header_len; 709 tp->ext_header_len - tp->tcp_header_len);
711 710
712 if (tp->max_window && 711 if (tp->max_window &&
713 (xmit_size_goal > (tp->max_window >> 1))) 712 (xmit_size_goal > (tp->max_window >> 1)))
@@ -1422,7 +1421,7 @@ int tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb)
1422 (sysctl_tcp_retrans_collapse != 0)) 1421 (sysctl_tcp_retrans_collapse != 0))
1423 tcp_retrans_try_collapse(sk, skb, cur_mss); 1422 tcp_retrans_try_collapse(sk, skb, cur_mss);
1424 1423
1425 if(tp->af_specific->rebuild_header(sk)) 1424 if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk))
1426 return -EHOSTUNREACH; /* Routing failure or similar. */ 1425 return -EHOSTUNREACH; /* Routing failure or similar. */
1427 1426
1428 /* Some Solaris stacks overoptimize and ignore the FIN on a 1427 /* Some Solaris stacks overoptimize and ignore the FIN on a
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
69static void tcp_v6_send_reset(struct sk_buff *skb); 69static void tcp_v6_send_reset(struct sk_buff *skb);
70static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req); 70static void tcp_v6_reqsk_send_ack(struct sk_buff *skb, struct request_sock *req);
71static void tcp_v6_send_check(struct sock *sk, struct tcphdr *th, int len, 71static void tcp_v6_send_check(struct sock *sk, int len,
72 struct sk_buff *skb); 72 struct sk_buff *skb);
73 73
74static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb); 74static int tcp_v6_do_rcv(struct sock *sk, struct sk_buff *skb);
75static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok); 75static int tcp_v6_xmit(struct sk_buff *skb, int ipfragok);
76 76
77static struct tcp_func ipv6_mapped; 77static struct inet_connection_sock_af_ops ipv6_mapped;
78static struct tcp_func ipv6_specific; 78static struct inet_connection_sock_af_ops ipv6_specific;
79 79
80int inet6_csk_bind_conflict(const struct sock *sk, 80int 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)
107static void tcp_v6_hash(struct sock *sk) 107static 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
754static void tcp_v6_send_check(struct sock *sk, struct tcphdr *th, int len, 752static 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
1634static struct tcp_func ipv6_specific = { 1632static 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
1653static struct tcp_func ipv6_mapped = { 1651static 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);