Source-Changes-HG archive

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

[src/trunk]: src/sys/netinet Make sure icmp_redirect_timeout_q and ip_mtudisc...



details:   https://anonhg.NetBSD.org/src/rev/818a58bf1d0d
branches:  trunk
changeset: 822175:818a58bf1d0d
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Mar 06 07:31:15 2017 +0000

description:
Make sure icmp_redirect_timeout_q and ip_mtudisc_timeout_q are initialized on bootup

Fix PR kern/52029

diffstat:

 sys/netinet/ip_icmp.c  |  11 +++--------
 sys/netinet/ip_input.c |   6 ++++--
 2 files changed, 7 insertions(+), 10 deletions(-)

diffs (66 lines):

diff -r a942432a3408 -r 818a58bf1d0d sys/netinet/ip_icmp.c
--- a/sys/netinet/ip_icmp.c     Mon Mar 06 07:15:47 2017 +0000
+++ b/sys/netinet/ip_icmp.c     Mon Mar 06 07:31:15 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_icmp.c,v 1.159 2017/02/17 04:32:10 ozaki-r Exp $    */
+/*     $NetBSD: ip_icmp.c,v 1.160 2017/03/06 07:31:15 ozaki-r Exp $    */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -94,7 +94,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.159 2017/02/17 04:32:10 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_icmp.c,v 1.160 2017/03/06 07:31:15 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ipsec.h"
@@ -195,10 +195,7 @@
         * something other than zero.
         */
        mutex_enter(&icmp_mtx);
-       if (icmp_redirtimeout != 0) {
-               icmp_redirect_timeout_q =
-                       rt_timer_queue_create(icmp_redirtimeout);
-       }
+       icmp_redirect_timeout_q = rt_timer_queue_create(icmp_redirtimeout);
        mutex_exit(&icmp_mtx);
 
        icmpstat_percpu = percpu_alloc(sizeof(uint64_t) * ICMP_NSTATS);
@@ -1205,8 +1202,6 @@
        }
 
        mutex_enter(&icmp_mtx);
-       if (ip_mtudisc_timeout_q == NULL)
-               ip_mtudisc_timeout_q = rt_timer_queue_create(ip_mtudisc_timeout);
        error = rt_timer_add(rt, icmp_mtudisc_timeout, ip_mtudisc_timeout_q);
        mutex_exit(&icmp_mtx);
        if (error) {
diff -r a942432a3408 -r 818a58bf1d0d sys/netinet/ip_input.c
--- a/sys/netinet/ip_input.c    Mon Mar 06 07:15:47 2017 +0000
+++ b/sys/netinet/ip_input.c    Mon Mar 06 07:31:15 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_input.c,v 1.351 2017/02/17 18:09:25 ozaki-r Exp $   */
+/*     $NetBSD: ip_input.c,v 1.352 2017/03/06 07:31:15 ozaki-r Exp $   */
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -91,7 +91,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.351 2017/02/17 18:09:25 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_input.c,v 1.352 2017/03/06 07:31:15 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -353,6 +353,8 @@
        ipforward_rt_percpu = percpu_alloc(sizeof(struct route));
        if (ipforward_rt_percpu == NULL)
                panic("failed to allocate ipforward_rt_percpu");
+
+       ip_mtudisc_timeout_q = rt_timer_queue_create(ip_mtudisc_timeout);
 }
 
 static struct in_ifaddr *



Home | Main Index | Thread Index | Old Index