Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Handle large offsets with very small options cor...



details:   https://anonhg.NetBSD.org/src/rev/c2fdf0571425
branches:  trunk
changeset: 485823:c2fdf0571425
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Sat May 06 16:35:14 2000 +0000

description:
Handle large offsets with very small options correctly.

diffstat:

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

diffs (27 lines):

diff -r 923a46dab8ed -r c2fdf0571425 sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c    Sat May 06 16:07:42 2000 +0000
+++ b/sys/netinet/ip_input.c    Sat May 06 16:35:14 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_input.c,v 1.111 2000/03/31 14:27:17 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.
@@ -1013,7 +1013,7 @@
                                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.
                                 */
@@ -1053,7 +1053,7 @@
                         * 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));



Home | Main Index | Thread Index | Old Index