Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/ip_input.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/netinet/ip_input.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.110 retrieving revision 1.112 diff -u -p -r1.110 -r1.112 --- src/sys/netinet/ip_input.c 2000/03/31 08:34:20 1.110 +++ src/sys/netinet/ip_input.c 2000/05/06 16:35:14 1.112 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.110 2000/03/31 08:34:20 jdolecek Exp $ */ +/* $NetBSD: ip_input.c,v 1.112 2000/05/06 16:35:14 sommerfeld Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -134,12 +134,15 @@ #include #include #include -#include #include /* just for gif_ttl */ #include #include "gif.h" +#ifdef MROUTING +#include +#endif + #ifdef IPSEC #include #include @@ -1010,7 +1013,7 @@ ip_dooptions(m) break; } off--; /* 0 origin */ - if (off > optlen - sizeof(struct in_addr)) { + if ((off + sizeof(struct in_addr)) > optlen) { /* * End of source route. Should be for us. */ @@ -1050,7 +1053,7 @@ ip_dooptions(m) * If no space remains, ignore. */ off--; /* 0 origin */ - if (off > optlen - sizeof(struct in_addr)) + if ((off + sizeof(struct in_addr)) > optlen) break; bcopy((caddr_t)(&ip->ip_dst), (caddr_t)&ipaddr.sin_addr, sizeof(ipaddr.sin_addr));