Re: multiple TCP sockets with same (srcip,dstip,sport,dport)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andi,
    Thanks for your patch. If I am not wrong, it seems to have two 
problems:

[1]  If  the new SYN is out of window, we do send an ACK back but
       we dont update the open_req's  rcv_isn.

[2]  If its in the window, we decide to send a RST which is fine, 
       but we need to free the open_req structure. 

Does that seem right ?

Thanks
Rajeev


----- Original Message ----- 
From: "Andi Kleen" <ak@suse.de>
To: <kuznet@ms2.inr.ac.ru>
Cc: "Rajeev Bector" <rajeev@akamai.com>; <linux-net@vger.rutgers.edu>
Sent: Saturday, July 08, 2000 9:37 AM
Subject: Re: multiple TCP sockets with same (srcip,dstip,sport,dport)


| On Sat, Jul 08, 2000 at 07:12:34PM +0400, A.N.Kuznetsov wrote:
| > If new SYN is inside window, but its sequence number is
| > different (it would not be not new otherwise 8)),
| > connection is aborted and reset is sent.
| 
| Ok, here is a patch.
| 
| --- linux/net/ipv4/tcp_input.c Sun Jul  2 13:14:12 2000
| +++ linux-work/net/ipv4/tcp_input.c Sat Jul  8 17:56:50 2000
| @@ -1990,14 +1990,16 @@
|   flg &= __constant_htonl(0x00170000);
|   /* Only SYN set? */
|   if (flg == __constant_htonl(0x00020000)) {
| - if (TCP_SKB_CB(skb)->seq == req->rcv_isn) {
| - /* retransmited syn.
| - */
| + __u32 seq = TCP_SKB_CB(skb)->seq;
| + /* Retransmission or out of window -> ACK */ 
| + if (seq == req->rcv_isn ||
| +     before(seq, req->rcv_isn) || 
| +     after(seq, req->rcv_isn + req->rcv_wnd)) { 
|   req->class->rtx_syn_ack(sk, req); 
| - return NULL;
|   } else {
| - return sk; /* Pass new SYN to the listen socket. */
| + req->class->send_reset(skb); 
|   }
| + return NULL; 
|   }
|  
|   /* We know it's an ACK here */ 
| 
| 
| 
| -Andi
| -
| : send the line "unsubscribe linux-net" in
| the body of a message to majordomo@vger.rutgers.edu

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux