don't call if_free_sadl() until very end of if_detach() logic. many of

routing table manipulation code assumes the presense of AF_LINK sockaddr.
should fix PR 21581
This commit is contained in:
itojun 2003-05-23 10:06:17 +00:00
parent 07fcae9efc
commit 8228c94987
4 changed files with 16 additions and 8 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ethersubr.c,v 1.108 2003/05/16 04:54:55 itojun Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.109 2003/05/23 10:06:17 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.108 2003/05/16 04:54:55 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ethersubr.c,v 1.109 2003/05/23 10:06:17 itojun Exp $");
#include "opt_inet.h"
#include "opt_atalk.h"
@ -1131,7 +1131,9 @@ ether_ifdetach(struct ifnet *ifp)
}
splx(s);
#if 0 /* done in if_detach() */
if_free_sadl(ifp);
#endif
MOWNER_DETACH(&ec->ec_rx_mowner);
MOWNER_DETACH(&ec->ec_tx_mowner);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ieee1394subr.c,v 1.22 2003/05/06 09:59:35 enami Exp $ */
/* $NetBSD: if_ieee1394subr.c,v 1.23 2003/05/23 10:06:18 itojun Exp $ */
/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.22 2003/05/06 09:59:35 enami Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ieee1394subr.c,v 1.23 2003/05/23 10:06:18 itojun Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -680,7 +680,9 @@ ieee1394_ifdetach(struct ifnet *ifp)
#endif
free(ifp->if_broadcastaddr, M_DEVBUF);
ifp->if_broadcastaddr = NULL;
#if 0 /* done in if_detach() */
if_free_sadl(ifp);
#endif
}
int

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_spppsubr.c,v 1.65 2003/05/14 23:16:44 itojun Exp $ */
/* $NetBSD: if_spppsubr.c,v 1.66 2003/05/23 10:06:18 itojun Exp $ */
/*
* Synchronous PPP/Cisco link level subroutines.
@ -41,7 +41,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.65 2003/05/14 23:16:44 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_spppsubr.c,v 1.66 2003/05/23 10:06:18 itojun Exp $");
#include "opt_inet.h"
#include "opt_ipx.h"
@ -989,7 +989,9 @@ sppp_detach(struct ifnet *ifp)
if (sp->hisauth.name) free(sp->hisauth.name, M_DEVBUF);
if (sp->hisauth.secret) free(sp->hisauth.secret, M_DEVBUF);
#if 0 /* done in if_detach() */
if_free_sadl(ifp);
#endif
}
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_tokensubr.c,v 1.21 2003/05/02 03:15:24 itojun Exp $ */
/* $NetBSD: if_tokensubr.c,v 1.22 2003/05/23 10:06:18 itojun Exp $ */
/*
* Copyright (c) 1997-1999
@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.21 2003/05/02 03:15:24 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_tokensubr.c,v 1.22 2003/05/23 10:06:18 itojun Exp $");
#include "opt_inet.h"
#include "opt_atalk.h"
@ -725,5 +725,7 @@ token_ifdetach(ifp)
#if NBPFILTER > 0
bpfdetach(ifp);
#endif
#if 0 /* done in if_detach() */
if_free_sadl(ifp);
#endif
}