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 retrieving revision 1.135.2.5 retrieving revision 1.135.2.6 diff -u -p -r1.135.2.5 -r1.135.2.6 --- src/sys/netinet/ip_input.c 2002/09/06 08:49:14 1.135.2.5 +++ src/sys/netinet/ip_input.c 2002/10/10 18:43:59 1.135.2.6 @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.135.2.5 2002/09/06 08:49:14 jdolecek Exp $ */ +/* $NetBSD: ip_input.c,v 1.135.2.6 2002/10/10 18:43:59 jdolecek Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. @@ -102,7 +102,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.135.2.5 2002/09/06 08:49:14 jdolecek Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.135.2.6 2002/10/10 18:43:59 jdolecek Exp $"); #include "opt_gateway.h" #include "opt_pfil_hooks.h" @@ -192,7 +192,7 @@ int ip_forwsrcrt = IPFORWSRCRT; int ip_directedbcast = IPDIRECTEDBCAST; int ip_allowsrcrt = IPALLOWSRCRT; int ip_mtudisc = IPMTUDISC; -u_int ip_mtudisc_timeout = IPMTUDISCTIMEOUT; +int ip_mtudisc_timeout = IPMTUDISCTIMEOUT; #ifdef DIAGNOSTIC int ipprintfs = 0; #endif @@ -1863,8 +1863,13 @@ ip_sysctl(name, namelen, oldp, oldlenp, } return (error); case IPCTL_MTUDISCTIMEOUT: + old = ip_mtudisc_timeout; error = sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtudisc_timeout); + if (ip_mtudisc_timeout < 0) { + ip_mtudisc_timeout = old; + return (EINVAL); + } if (ip_mtudisc_timeout_q != NULL) rt_timer_queue_change(ip_mtudisc_timeout_q, ip_mtudisc_timeout); @@ -1887,13 +1892,13 @@ ip_sysctl(name, namelen, oldp, oldlenp, &hostzeroisbroadcast)); #if NGIF > 0 case IPCTL_GIF_TTL: - return(sysctl_int(oldp, oldlenp, newp, newlen, + return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_gif_ttl)); #endif #if NGRE > 0 case IPCTL_GRE_TTL: - return(sysctl_int(oldp, oldlenp, newp, newlen, + return (sysctl_int(oldp, oldlenp, newp, newlen, &ip_gre_ttl)); #endif