aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@mandriva.com>2005-12-14 02:26:10 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-01-03 16:10:58 -0500
commitd83d8461f902c672bc1bd8fbc6a94e19f092da97 (patch)
tree0534c553ab92baa2eb9dbb5bba64f2c4540b1e89 /net/ipv4/tcp_ipv4.c
parent22712813620fa8e682dbfb253a60ca0131da1e07 (diff)
[IP_SOCKGLUE]: Remove most of the tcp specific calls
As DCCP needs to be called in the same spots. Now we have a member in inet_sock (is_icsk), set at sock creation time from struct inet_protosw->flags (if INET_PROTOSW_ICSK is set, like for TCP and DCCP) to see if a struct sock instance is a inet_connection_sock for places like the ones in ip_sockglue.c (v4 and v6) where we previously were looking if sk_type was SOCK_STREAM, that is insufficient because we now use the same code for DCCP, that has sk_type SOCK_DCCP. Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
-rw-r--r--net/ipv4/tcp_ipv4.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
index c2fe61becd61..9b62d80bb20f 100644
--- a/net/ipv4/tcp_ipv4.c
+++ b/net/ipv4/tcp_ipv4.c
@@ -220,9 +220,9 @@ int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len)
220 inet->dport = usin->sin_port; 220 inet->dport = usin->sin_port;
221 inet->daddr = daddr; 221 inet->daddr = daddr;
222 222
223 tp->ext_header_len = 0; 223 inet_csk(sk)->icsk_ext_hdr_len = 0;
224 if (inet->opt) 224 if (inet->opt)
225 tp->ext_header_len = inet->opt->optlen; 225 inet_csk(sk)->icsk_ext_hdr_len = inet->opt->optlen;
226 226
227 tp->rx_opt.mss_clamp = 536; 227 tp->rx_opt.mss_clamp = 536;
228 228
@@ -275,7 +275,6 @@ static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph,
275{ 275{
276 struct dst_entry *dst; 276 struct dst_entry *dst;
277 struct inet_sock *inet = inet_sk(sk); 277 struct inet_sock *inet = inet_sk(sk);
278 struct tcp_sock *tp = tcp_sk(sk);
279 278
280 /* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs 279 /* We are not interested in TCP_LISTEN and open_requests (SYN-ACKs
281 * send out by Linux are always <576bytes so they should go through 280 * send out by Linux are always <576bytes so they should go through
@@ -304,7 +303,7 @@ static inline void do_pmtu_discovery(struct sock *sk, struct iphdr *iph,
304 mtu = dst_mtu(dst); 303 mtu = dst_mtu(dst);
305 304
306 if (inet->pmtudisc != IP_PMTUDISC_DONT && 305 if (inet->pmtudisc != IP_PMTUDISC_DONT &&
307 tp->pmtu_cookie > mtu) { 306 inet_csk(sk)->icsk_pmtu_cookie > mtu) {
308 tcp_sync_mss(sk, mtu); 307 tcp_sync_mss(sk, mtu);
309 308
310 /* Resend the TCP packet because it's 309 /* Resend the TCP packet because it's
@@ -895,9 +894,9 @@ struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
895 ireq->opt = NULL; 894 ireq->opt = NULL;
896 newinet->mc_index = inet_iif(skb); 895 newinet->mc_index = inet_iif(skb);
897 newinet->mc_ttl = skb->nh.iph->ttl; 896 newinet->mc_ttl = skb->nh.iph->ttl;
898 newtp->ext_header_len = 0; 897 inet_csk(newsk)->icsk_ext_hdr_len = 0;
899 if (newinet->opt) 898 if (newinet->opt)
900 newtp->ext_header_len = newinet->opt->optlen; 899 inet_csk(newsk)->icsk_ext_hdr_len = newinet->opt->optlen;
901 newinet->id = newtp->write_seq ^ jiffies; 900 newinet->id = newtp->write_seq ^ jiffies;
902 901
903 tcp_sync_mss(newsk, dst_mtu(dst)); 902 tcp_sync_mss(newsk, dst_mtu(dst));
@@ -1266,6 +1265,7 @@ static int tcp_v4_init_sock(struct sock *sk)
1266 sock_set_flag(sk, SOCK_USE_WRITE_QUEUE); 1265 sock_set_flag(sk, SOCK_USE_WRITE_QUEUE);
1267 1266
1268 icsk->icsk_af_ops = &ipv4_specific; 1267 icsk->icsk_af_ops = &ipv4_specific;
1268 icsk->icsk_sync_mss = tcp_sync_mss;
1269 1269
1270 sk->sk_sndbuf = sysctl_tcp_wmem[1]; 1270 sk->sk_sndbuf = sysctl_tcp_wmem[1];
1271 sk->sk_rcvbuf = sysctl_tcp_rmem[1]; 1271 sk->sk_rcvbuf = sysctl_tcp_rmem[1];