NetBSD-Bugs archive

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

Re: kern/43510: kernel reply TCP-RST for bad checksum TCP-SYN packet



The following reply was made to PR kern/43510; it has been noted by GNATS.

From: Mihai Chelaru <mihai.chelaru%NGNetworks.ro@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: netbsd-bugs%netbsd.org@localhost, ryo%iij.ad.jp@localhost
Subject: Re: kern/43510: kernel reply TCP-RST for bad checksum TCP-SYN packet
Date: Fri, 25 Jun 2010 20:23:44 +0300

 This is a multi-part message in MIME format.
 --------------020908070003060306010607
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 On 06/25/10 13:10, ryo%iij.ad.jp@localhost wrote:
 >> Synopsis:       kernel reply TCP-RST for bad checksum TCP-SYN packet
 
 Try the attached patch, it should fix the issue. I will not commit it
 yet, I need to ask people with more TCP knowledge if it's OK.
 
 From RFC793 section 1.5: Damage is handled by adding a checksum to each
 segment transmitted, checking it at the receiver, and discarding damaged
 segments.
 
 -- 
 Mihai
 
 --------------020908070003060306010607
 Content-Type: text/plain;
  name="c.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="c.diff"
 
 Index: tcp_input.c
 ===================================================================
 RCS file: /cvsroot/src/sys/netinet/tcp_input.c,v
 retrieving revision 1.305
 diff -u -p -r1.305 tcp_input.c
 --- tcp_input.c        26 May 2010 17:38:29 -0000      1.305
 +++ tcp_input.c        25 Jun 2010 17:20:22 -0000
 @@ -1185,6 +1185,12 @@ tcp_input(struct mbuf *m, ...)
        tiflags = th->th_flags;
  
        /*
 +       * Checksum extended TCP header and data.
 +       */
 +      if (tcp_input_checksum(af, m, th, toff, off, tlen))
 +              goto badcsum;
 +
 +      /*
         * Locate pcb for segment.
         */
  findpcb:
 @@ -1322,12 +1328,6 @@ findpcb:
        KASSERT(so->so_lock == softnet_lock);
        KASSERT(solocked(so));
  
 -      /*
 -       * Checksum extended TCP header and data.
 -       */
 -      if (tcp_input_checksum(af, m, th, toff, off, tlen))
 -              goto badcsum;
 -
        tcp_fields_to_host(th);
  
        /* Unscale the window into a 32-bit value. */
 
 --------------020908070003060306010607--
 


Home | Main Index | Thread Index | Old Index