diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-18 22:06:10 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-18 22:06:10 +0000 |
commit | aba4e552a2f2c1492441acbccedd8e0a4c53f916 (patch) | |
tree | 23921efb2b4af590160f034a89ff3da2ecca6e47 /net/ipv4 | |
parent | 9e17e1aa1cf1cb497d2f67147a51831888affcf3 (diff) |
Merge with Linux 2.3.43.
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/ipconfig.c | 2 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 8 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 60 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 4 |
5 files changed, 32 insertions, 45 deletions
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index d4d556cb5..82e443d4d 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c @@ -1,5 +1,5 @@ /* - * $Id: ipconfig.c,v 1.25 2000/01/09 02:19:31 davem Exp $ + * $Id: ipconfig.c,v 1.26 2000/01/29 07:42:08 davem Exp $ * * Automatic Configuration of IP -- use BOOTP or RARP or user-supplied * information to configure own IP address and routes. diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index e01892326..aa890aef3 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp.c,v 1.160 2000/01/24 18:40:32 davem Exp $ + * Version: $Id: tcp.c,v 1.161 2000/01/31 01:21:16 davem Exp $ * * Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> @@ -1119,7 +1119,7 @@ static void cleanup_rbuf(struct sock *sk, int copied) /* Delayed ACKs frequently hit locked sockets during bulk receive. */ time_to_ack = tp->ack.blocked && tp->ack.pending; -#if 1/*def CONFIG_TCP_MORE_COARSE_ACKS*/ +#ifdef CONFIG_TCP_MORE_COARSE_ACKS if (tp->ack.pending && (tp->rcv_nxt - tp->rcv_wup) > tp->ack.rcv_mss) time_to_ack = 1; @@ -1344,7 +1344,7 @@ int tcp_recvmsg(struct sock *sk, struct msghdr *msg, tp->ucopy.len = len; - BUG_TRAP(tp->copied_seq == tp->rcv_nxt); + BUG_TRAP(tp->copied_seq == tp->rcv_nxt || (flags&MSG_PEEK)); /* Ugly... If prequeue is not empty, we have to * process it before releasing socket, otherwise @@ -1408,7 +1408,7 @@ do_prequeue: copied += chunk; } } -#if 1/*def CONFIG_TCP_MORE_COARSE_ACKS*/ +#ifdef CONFIG_TCP_MORE_COARSE_ACKS if (tp->ack.pending && (tp->rcv_nxt - tp->rcv_wup) > tp->ack.rcv_mss) tcp_send_ack(sk); diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d61a5df02..366dddc89 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_input.c,v 1.183 2000/01/24 18:40:33 davem Exp $ + * Version: $Id: tcp_input.c,v 1.186 2000/01/31 20:26:13 davem Exp $ * * Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> @@ -1346,7 +1346,8 @@ tcp_timewait_state_process(struct tcp_tw_bucket *tw, struct sk_buff *skb, goto kill_with_rst; /* Dup ACK? */ - if (!after(TCP_SKB_CB(skb)->end_seq, tw->rcv_nxt)) { + if (!after(TCP_SKB_CB(skb)->end_seq, tw->rcv_nxt) || + TCP_SKB_CB(skb)->end_seq == TCP_SKB_CB(skb)->seq) { tcp_tw_put(tw); return TCP_TW_SUCCESS; } @@ -1912,6 +1913,8 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb) !tp->urg_data) { int chunk = min(skb->len, tp->ucopy.len); + __set_current_state(TASK_RUNNING); + local_bh_enable(); if (memcpy_toiovec(tp->ucopy.iov, skb->data, chunk)) { sk->err = EFAULT; @@ -1948,10 +1951,9 @@ queue_and_out: !tp->urg_data) tcp_fast_path_on(tp); - if (eaten) + if (eaten) { kfree_skb(skb); - - if (!sk->dead) { + } else if (!sk->dead) { wake_up_interruptible(sk->sleep); sock_wake_async(sk->socket,1, POLL_IN); } @@ -2296,29 +2298,7 @@ static int prune_queue(struct sock *sk) * fails? -ANK */ - /* F.e. one possible tactics is: */ - do { - u32 new_clamp = (tp->rcv_nxt-tp->copied_seq) + pruned; - - /* This guy is not a good guy. I bet, he martirized cats, - * when was child and grew up to finished sadist. Clamp him! - */ - if (new_clamp > 3*tp->ack.rcv_mss) - new_clamp -= tp->ack.rcv_mss; - else - new_clamp = 2*tp->ack.rcv_mss; - tp->window_clamp = min(tp->window_clamp, new_clamp); - } while (0); - /* Though it should be made earlier, when we are still not - * congested. This header prediction logic sucks - * without true implementation of VJ algorithm. - * I am really anxious. How was it possible to combine - * header prediction and sending ACKs outside of recvmsg() context? - * They _are_ incompatible. We should not advance window so - * brainlessly and we should not advertise so huge window from the very - * beginning. BTW window "prediction" does not speedup anything! - * SIlly, silly, silly. - */ + tp->ack.quick = 0; if(atomic_read(&sk->rmem_alloc) < (sk->rcvbuf << 1)) return 0; @@ -2525,10 +2505,14 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, NET_INC_STATS_BH(TCPHPHitsToUser); + __set_current_state(TASK_RUNNING); + if (tcp_copy_to_iovec(sk, skb, tcp_header_len)) goto csum_error; __skb_pull(skb,tcp_header_len); + + tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; } else { if (tcp_checksum_complete_user(sk, skb)) goto csum_error; @@ -2548,15 +2532,15 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, */ __skb_queue_tail(&sk->receive_queue, skb); skb_set_owner_r(skb, sk); - } - tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; + tp->rcv_nxt = TCP_SKB_CB(skb)->end_seq; - /* FIN bit check is not done since if FIN is set in - * this frame, the pred_flags won't match up. -DaveM - */ - wake_up_interruptible(sk->sleep); - sock_wake_async(sk->socket,1, POLL_IN); + /* FIN bit check is not done since if FIN is set in + * this frame, the pred_flags won't match up. -DaveM + */ + wake_up_interruptible(sk->sleep); + sock_wake_async(sk->socket,1, POLL_IN); + } tcp_event_data_recv(tp, skb); @@ -3467,7 +3451,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, int tmo; if (tp->linger2 < 0 || - after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) { + (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && + after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt))) { tcp_done(sk); return 1; } @@ -3526,7 +3511,8 @@ step6: * BSD 4.4 also does reset. */ if (sk->shutdown & RCV_SHUTDOWN) { - if (after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) { + if (TCP_SKB_CB(skb)->end_seq != TCP_SKB_CB(skb)->seq && + after(TCP_SKB_CB(skb)->end_seq - th->fin, tp->rcv_nxt)) { tcp_reset(sk); return 1; } diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 7420e268f..e54ce2ec2 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_ipv4.c,v 1.197 2000/01/21 06:37:28 davem Exp $ + * Version: $Id: tcp_ipv4.c,v 1.198 2000/01/31 01:21:20 davem Exp $ * * IPv4 specific functions * @@ -598,6 +598,7 @@ unique: *skp = sk; sk->pprev = skp; + sk->hashent = hash; sock_prot_inc_use(sk->prot); write_unlock_bh(&head->lock); diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index d6bc8a205..5583ea6cb 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -5,7 +5,7 @@ * * Implementation of the Transmission Control Protocol(TCP). * - * Version: $Id: tcp_output.c,v 1.119 2000/01/19 04:06:15 davem Exp $ + * Version: $Id: tcp_output.c,v 1.120 2000/01/31 01:21:22 davem Exp $ * * Authors: Ross Biro, <bir7@leland.Stanford.Edu> * Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> @@ -1005,7 +1005,7 @@ int tcp_connect(struct sock *sk, struct sk_buff *buff) struct tcp_opt *tp = &(sk->tp_pinfo.af_tcp); /* Reserve space for headers. */ - skb_reserve(buff, MAX_TCP_HEADER + 15); + skb_reserve(buff, MAX_TCP_HEADER); /* We'll fix this up when we get a response from the other end. * See tcp_input.c:tcp_rcv_state_process case TCP_SYN_SENT. |