Module Name:    src
Committed By:   ozaki-r
Date:           Fri Oct 28 05:52:05 UTC 2016

Modified Files:
        src/sys/net: if.c

Log Message:
Fix the position of IFADDR_ENTRY_DESTROY

It must be called after all readers left, i.e, after pserialize_perform.


To generate a diff of this commit:
cvs rdiff -u -r1.359 -r1.360 src/sys/net/if.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/net/if.c
diff -u src/sys/net/if.c:1.359 src/sys/net/if.c:1.360
--- src/sys/net/if.c:1.359	Tue Oct 18 07:30:30 2016
+++ src/sys/net/if.c	Fri Oct 28 05:52:05 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.359 2016/10/18 07:30:30 ozaki-r Exp $	*/
+/*	$NetBSD: if.c,v 1.360 2016/10/28 05:52:05 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.359 2016/10/18 07:30:30 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.360 2016/10/28 05:52:05 ozaki-r Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_inet.h"
@@ -1621,7 +1621,6 @@ ifa_remove(struct ifnet *ifp, struct ifa
 	IFNET_LOCK();
 	TAILQ_REMOVE(&ifp->if_addrlist, ifa, ifa_list);
 	IFADDR_WRITER_REMOVE(ifa);
-	IFADDR_ENTRY_DESTROY(ifa);
 #ifdef NET_MPSAFE
 	pserialize_perform(ifnet_psz);
 #endif
@@ -1630,6 +1629,7 @@ ifa_remove(struct ifnet *ifp, struct ifa
 #ifdef NET_MPSAFE
 	psref_target_destroy(&ifa->ifa_psref, ifa_psref_class);
 #endif
+	IFADDR_ENTRY_DESTROY(ifa);
 	ifafree(ifa);
 }
 

Reply via email to