]> git.ipfire.org Git - thirdparty/dhcp.git/commitdiff
Extra sanity check on uh_ulen.
authorTed Lemon <source@isc.org>
Wed, 20 Sep 2000 09:03:34 +0000 (09:03 +0000)
committerTed Lemon <source@isc.org>
Wed, 20 Sep 2000 09:03:34 +0000 (09:03 +0000)
common/packet.c

index 5099c112df53900ae033f4fd21185673b55c8a4d..0007239499b16e8cb6d3622c48726513a71b4e08 100644 (file)
@@ -42,7 +42,7 @@
 
 #ifndef lint
 static char copyright[] =
-"$Id: packet.c,v 1.34 2000/04/14 16:22:04 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
+"$Id: packet.c,v 1.35 2000/09/20 09:03:34 mellon Exp $ Copyright (c) 1996-2000 The Internet Software Consortium.  All rights reserved.\n";
 #endif /* not lint */
 
 #include "dhcpd.h"
@@ -294,8 +294,11 @@ ssize_t decode_udp_ip_header (interface, buf, bufix, from, data, buflen)
                  }
                  return -1;
          }
-         if (len + data != buf + bufix + buflen)
+         if (len + data < buf + bufix + buflen)
                  log_debug ("accepting packet with data after udp payload.");
+         if (len + data > buf + bufix + buflen) {
+                 log_debug ("dropping packet with bogus uh_ulen %d",
+                            len + sizeof *udp);
   }
 
   usum = udp -> uh_sum;