diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-12-14 02:26:10 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 16:10:58 -0500 |
commit | d83d8461f902c672bc1bd8fbc6a94e19f092da97 (patch) | |
tree | 0534c553ab92baa2eb9dbb5bba64f2c4540b1e89 /net/ipv4/tcp_input.c | |
parent | 22712813620fa8e682dbfb253a60ca0131da1e07 (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_input.c')
-rw-r--r-- | net/ipv4/tcp_input.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 7de6184d4bd8..981d1203b152 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2342,7 +2342,7 @@ static int tcp_ack_update_window(struct sock *sk, struct tcp_sock *tp, | |||
2342 | 2342 | ||
2343 | if (nwin > tp->max_window) { | 2343 | if (nwin > tp->max_window) { |
2344 | tp->max_window = nwin; | 2344 | tp->max_window = nwin; |
2345 | tcp_sync_mss(sk, tp->pmtu_cookie); | 2345 | tcp_sync_mss(sk, inet_csk(sk)->icsk_pmtu_cookie); |
2346 | } | 2346 | } |
2347 | } | 2347 | } |
2348 | } | 2348 | } |
@@ -3967,12 +3967,12 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, | |||
3967 | struct tcphdr *th, unsigned len) | 3967 | struct tcphdr *th, unsigned len) |
3968 | { | 3968 | { |
3969 | struct tcp_sock *tp = tcp_sk(sk); | 3969 | struct tcp_sock *tp = tcp_sk(sk); |
3970 | struct inet_connection_sock *icsk = inet_csk(sk); | ||
3970 | int saved_clamp = tp->rx_opt.mss_clamp; | 3971 | int saved_clamp = tp->rx_opt.mss_clamp; |
3971 | 3972 | ||
3972 | tcp_parse_options(skb, &tp->rx_opt, 0); | 3973 | tcp_parse_options(skb, &tp->rx_opt, 0); |
3973 | 3974 | ||
3974 | if (th->ack) { | 3975 | if (th->ack) { |
3975 | struct inet_connection_sock *icsk; | ||
3976 | /* rfc793: | 3976 | /* rfc793: |
3977 | * "If the state is SYN-SENT then | 3977 | * "If the state is SYN-SENT then |
3978 | * first check the ACK bit | 3978 | * first check the ACK bit |
@@ -4061,7 +4061,7 @@ static int tcp_rcv_synsent_state_process(struct sock *sk, struct sk_buff *skb, | |||
4061 | if (tp->rx_opt.sack_ok && sysctl_tcp_fack) | 4061 | if (tp->rx_opt.sack_ok && sysctl_tcp_fack) |
4062 | tp->rx_opt.sack_ok |= 2; | 4062 | tp->rx_opt.sack_ok |= 2; |
4063 | 4063 | ||
4064 | tcp_sync_mss(sk, tp->pmtu_cookie); | 4064 | tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); |
4065 | tcp_initialize_rcv_mss(sk); | 4065 | tcp_initialize_rcv_mss(sk); |
4066 | 4066 | ||
4067 | /* Remember, tcp_poll() does not lock socket! | 4067 | /* Remember, tcp_poll() does not lock socket! |
@@ -4071,8 +4071,6 @@ 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 | |||
4076 | /* Make sure socket is routed, for correct metrics. */ | 4074 | /* Make sure socket is routed, for correct metrics. */ |
4077 | icsk->icsk_af_ops->rebuild_header(sk); | 4075 | icsk->icsk_af_ops->rebuild_header(sk); |
4078 | 4076 | ||
@@ -4173,7 +4171,7 @@ discard: | |||
4173 | if (tp->ecn_flags&TCP_ECN_OK) | 4171 | if (tp->ecn_flags&TCP_ECN_OK) |
4174 | sock_set_flag(sk, SOCK_NO_LARGESEND); | 4172 | sock_set_flag(sk, SOCK_NO_LARGESEND); |
4175 | 4173 | ||
4176 | tcp_sync_mss(sk, tp->pmtu_cookie); | 4174 | tcp_sync_mss(sk, icsk->icsk_pmtu_cookie); |
4177 | tcp_initialize_rcv_mss(sk); | 4175 | tcp_initialize_rcv_mss(sk); |
4178 | 4176 | ||
4179 | 4177 | ||