Source-Changes-HG archive

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

[src/trunk]: src/sys/net Remove an ifnet object from the global list before d...



details:   https://anonhg.NetBSD.org/src/rev/b74d519030ba
branches:  trunk
changeset: 341731:b74d519030ba
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Fri Nov 20 08:10:36 2015 +0000

description:
Remove an ifnet object from the global list before destructing it

diffstat:

 sys/net/if.c |  11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diffs (39 lines):

diff -r d7b153e1c11d -r b74d519030ba sys/net/if.c
--- a/sys/net/if.c      Fri Nov 20 07:20:21 2015 +0000
+++ b/sys/net/if.c      Fri Nov 20 08:10:36 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.c,v 1.318 2015/08/31 08:02:44 ozaki-r Exp $ */
+/*     $NetBSD: if.c,v 1.319 2015/11/20 08:10:36 ozaki-r Exp $ */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.318 2015/08/31 08:02:44 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.319 2015/11/20 08:10:36 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -756,6 +756,9 @@
 
        s = splnet();
 
+       ifindex2ifnet[ifp->if_index] = NULL;
+       TAILQ_REMOVE(&ifnet_list, ifp, if_list);
+
        if (ifp->if_slowtimo != NULL) {
                ifp->if_slowtimo = NULL;
                callout_halt(ifp->if_slowtimo_ch, NULL);
@@ -890,10 +893,6 @@
        /* Announce that the interface is gone. */
        rt_ifannouncemsg(ifp, IFAN_DEPARTURE);
 
-       ifindex2ifnet[ifp->if_index] = NULL;
-
-       TAILQ_REMOVE(&ifnet_list, ifp, if_list);
-
        ifioctl_detach(ifp);
 
        /*



Home | Main Index | Thread Index | Old Index