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.150.4.3 retrieving revision 1.153 diff -u -p -r1.150.4.3 -r1.153 --- src/sys/netinet/ip_input.c 2003/06/17 11:55:53 1.150.4.3 +++ src/sys/netinet/ip_input.c 2002/06/13 16:25:54 1.153 @@ -1,9 +1,9 @@ -/* $NetBSD: ip_input.c,v 1.150.4.3 2003/06/17 11:55:53 msaitoh Exp $ */ +/* $NetBSD: ip_input.c,v 1.153 2002/06/13 16:25:54 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -15,7 +15,7 @@ * 3. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -102,7 +102,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.150.4.3 2003/06/17 11:55:53 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.153 2002/06/13 16:25:54 itojun Exp $"); #include "opt_gateway.h" #include "opt_pfil_hooks.h" @@ -168,7 +168,7 @@ __KERNEL_RCSID(0, "$NetBSD: ip_input.c,v #define IPALLOWSRCRT 1 /* allow source-routed packets */ #endif #ifndef IPMTUDISC -#define IPMTUDISC 0 +#define IPMTUDISC 1 #endif #ifndef IPMTUDISCTIMEOUT #define IPMTUDISCTIMEOUT (10 * 60) /* as per RFC 1191 */ @@ -338,7 +338,9 @@ ip_init() TAILQ_INIT(&in_ifaddr); in_ifaddrhashtbl = hashinit(IN_IFADDR_HASH_SIZE, HASH_LIST, M_IFADDR, M_WAITOK, &in_ifaddrhash); - ip_mtudisc_timeout_q = rt_timer_queue_create(ip_mtudisc_timeout); + if (ip_mtudisc != 0) + ip_mtudisc_timeout_q = + rt_timer_queue_create(ip_mtudisc_timeout); #ifdef GATEWAY ipflow_init(); #endif @@ -1804,8 +1806,13 @@ ip_sysctl(name, namelen, oldp, oldlenp, case IPCTL_MTUDISC: error = sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtudisc); - if (error == 0 && ip_mtudisc == 0) - rt_timer_queue_remove_all(ip_mtudisc_timeout_q, TRUE); + if (ip_mtudisc != 0 && ip_mtudisc_timeout_q == NULL) { + ip_mtudisc_timeout_q = + rt_timer_queue_create(ip_mtudisc_timeout); + } else if (ip_mtudisc == 0 && ip_mtudisc_timeout_q != NULL) { + rt_timer_queue_destroy(ip_mtudisc_timeout_q, TRUE); + ip_mtudisc_timeout_q = NULL; + } return error; case IPCTL_ANONPORTMIN: old = anonportmin; @@ -1836,8 +1843,8 @@ ip_sysctl(name, namelen, oldp, oldlenp, case IPCTL_MTUDISCTIMEOUT: error = sysctl_int(oldp, oldlenp, newp, newlen, &ip_mtudisc_timeout); - if (error == 0) - rt_timer_queue_change(ip_mtudisc_timeout_q, + if (ip_mtudisc_timeout_q != NULL) + rt_timer_queue_change(ip_mtudisc_timeout_q, ip_mtudisc_timeout); return (error); #ifdef GATEWAY