Don't forget to call bpfdetach in the clone destroy function.

While here, add a missing static and change some spaces to tabs.
This commit is contained in:
peter 2004-12-05 15:00:47 +00:00
parent 8194ddc3a5
commit cf47c76c1b
3 changed files with 36 additions and 28 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ppp.c,v 1.93 2004/12/05 13:32:03 he Exp $ */
/* $NetBSD: if_ppp.c,v 1.94 2004/12/05 15:00:47 peter Exp $ */
/* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */
/*
@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.93 2004/12/05 13:32:03 he Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.94 2004/12/05 15:00:47 peter Exp $");
#include "ppp.h"
@ -336,6 +336,9 @@ ppp_clone_destroy(struct ifnet *ifp)
LIST_REMOVE(sc, sc_iflist);
simple_unlock(&ppp_list_mutex);
#if NBPFILTER > 0
bpfdetach(ifp);
#endif
if_detach(ifp);
FREE(sc, M_DEVBUF);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_sl.c,v 1.88 2004/12/05 14:56:50 he Exp $ */
/* $NetBSD: if_sl.c,v 1.89 2004/12/05 15:00:47 peter Exp $ */
/*
* Copyright (c) 1987, 1989, 1992, 1993
@ -60,7 +60,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.88 2004/12/05 14:56:50 he Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_sl.c,v 1.89 2004/12/05 15:00:47 peter Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -201,7 +201,7 @@ slattach(void)
if_clone_attach(&sl_cloner);
}
int
static int
sl_clone_create(struct if_clone *ifc, int unit)
{
struct sl_softc *sc;
@ -212,8 +212,7 @@ sl_clone_create(struct if_clone *ifc, int unit)
"%s%d", ifc->ifc_name, unit);
sc->sc_if.if_softc = sc;
sc->sc_if.if_mtu = SLMTU;
sc->sc_if.if_flags =
IFF_POINTOPOINT | SC_AUTOCOMP | IFF_MULTICAST;
sc->sc_if.if_flags = IFF_POINTOPOINT | SC_AUTOCOMP | IFF_MULTICAST;
sc->sc_if.if_type = IFT_SLIP;
sc->sc_if.if_ioctl = slioctl;
sc->sc_if.if_output = sloutput;
@ -239,6 +238,9 @@ sl_clone_destroy(struct ifnet *ifp)
LIST_REMOVE(sc, sc_iflist);
#if NBPFILTER > 0
bpfdetach(ifp);
#endif
if_detach(ifp);
FREE(sc, M_DEVBUF);

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_strip.c,v 1.55 2004/12/05 06:53:33 christos Exp $ */
/* $NetBSD: if_strip.c,v 1.56 2004/12/05 15:00:47 peter Exp $ */
/* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */
/*
@ -87,7 +87,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.55 2004/12/05 06:53:33 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_strip.c,v 1.56 2004/12/05 15:00:47 peter Exp $");
#include "opt_inet.h"
#include "bpfilter.h"
@ -341,7 +341,7 @@ stripattach(void)
if_clone_attach(&strip_cloner);
}
int
static int
strip_clone_create(struct if_clone *ifc, int unit)
{
struct strip_softc *sc;
@ -385,6 +385,9 @@ strip_clone_destroy(struct ifnet *ifp)
LIST_REMOVE(sc, sc_iflist);
#if NBPFILTER > 0
bpfdetach(ifp);
#endif
if_detach(ifp);
FREE(sc, M_DEVBUF);