Source-Changes-HG archive

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

[src/netbsd-1-6]: src/sys/netinet Pull up revision 1.54 (requested by sommerf...



details:   https://anonhg.NetBSD.org/src/rev/a1eeaffe0144
branches:  netbsd-1-6
changeset: 529161:a1eeaffe0144
user:      lukem <lukem%NetBSD.org@localhost>
date:      Sun Oct 13 23:55:41 2002 +0000

description:
Pull up revision 1.54 (requested by sommerfeld in ticket #884):
Relax overly-conservative TCP option parsing used by ipnat when
hunting for an MSS option to clamp.  The previous code assumed that at least
one more byte of options (such as a TCPOPT_EOL) would follow the MSS
option; now, we allow the MSS option to end on the last byte of the
TCP header.
Packets have been observed "in the wild" with a TCP header length of
'6' (24 bytes.. 20 bytes fixed header, 4 bytes options) with a 4-byte
MSS option exactly filling the 4 bytes of options payload and no
following TCPOPT_EOL.
RFC793 is quite explicit that the EOL byte:
        " .. need only be used if the end of the options would not
        otherwise coincide with the end of the TCP header."

diffstat:

 sys/netinet/ip_nat.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5998d400ac4a -r a1eeaffe0144 sys/netinet/ip_nat.c
--- a/sys/netinet/ip_nat.c      Sun Oct 13 23:38:54 2002 +0000
+++ b/sys/netinet/ip_nat.c      Sun Oct 13 23:55:41 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_nat.c,v 1.48.4.2 2002/06/05 13:49:39 lukem Exp $    */
+/*     $NetBSD: ip_nat.c,v 1.48.4.3 2002/10/13 23:55:41 lukem Exp $    */
 
 /*
  * Copyright (C) 1995-2001 by Darren Reed.
@@ -112,7 +112,7 @@
 #if !defined(lint)
 #if defined(__NetBSD__)
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.48.4.2 2002/06/05 13:49:39 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_nat.c,v 1.48.4.3 2002/10/13 23:55:41 lukem Exp $");
 #else
 static const char sccsid[] = "@(#)ip_nat.c     1.11 6/5/96 (C) 1995 Darren Reed";
 static const char rcsid[] = "@(#)Id: ip_nat.c,v 2.37.2.67 2002/04/27 15:23:39 darrenr Exp";
@@ -1171,7 +1171,7 @@
                        if (&cp[1] >= ep)
                                break;
                        advance = cp[1];
-                       if (&cp[advance] >= ep)
+                       if (&cp[advance] > ep)
                                break;
                        switch (opt) {
                        case TCPOPT_MAXSEG:



Home | Main Index | Thread Index | Old Index