Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Mar 2001 09:07:07 -0800 (PST)
From:      Ruslan Ermilov <ru@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/sys/netinet ip_output.c
Message-ID:  <200103131707.f2DH77e40642@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
ru          2001/03/13 09:07:07 PST

  Modified files:
    sys/netinet          ip_output.c 
  Log:
  RFC768 (UDP) requires that "if the computed checksum is zero, it
  is transmitted as all ones".  This got broken after introduction
  of delayed checksums as follows.  Some guys (including Jonathan)
  think that it is allowed to transmit all ones in place of a zero
  checksum for TCP the same way as for UDP.  (The discussion still
  takes place on -net.)  Thus, the 0 -> 0xffff checksum fixup was
  first moved from udp_output() (see udp_usrreq.c, 1.64 -> 1.65)
  to in_cksum_skip() (see sys/i386/i386/in_cksum.c, 1.17 -> 1.18,
  INVERT expression).  Besides that I disagree that it is valid for
  TCP, there was no real problem until in_cksum.c,v 1.20, where the
  in_cksum() was made just a special version of in_cksum_skip().
  The side effect was that now every incoming IP datagram failed to
  pass the checksum test (in_cksum() returned 0xffff when it should
  actually return zero).  It was fixed next day in revision 1.21,
  by removing the INVERT expression.  The latter also broke the
  0 -> 0xffff fixup for UDP checksums.
  
  Before this change:
  : tcpdump: listening on lo0
  : 127.0.0.1.33005 > 127.0.0.1.33006:  udp 0 (ttl 64, id 1)
  :                          4500 001c 0001 0000 4011 7cce 7f00 0001
  :                          7f00 0001 80ed 80ee 0008 0000
  
  After this change:
  : tcpdump: listening on lo0
  : 127.0.0.1.33005 > 127.0.0.1.33006:  udp 0 (ttl 64, id 1)
  :                          4500 001c 0001 0000 4011 7cce 7f00 0001
  :                          7f00 0001 80ed 80ee 0008 ffff
  
  Revision  Changes    Path
  1.124     +6 -4      src/sys/netinet/ip_output.c


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103131707.f2DH77e40642>