-/* $OpenBSD: if_pppx.c,v 1.108 2021/02/01 07:46:55 mvs Exp $ */
+/* $OpenBSD: if_pppx.c,v 1.109 2021/02/10 13:38:46 mvs Exp $ */
/*
* Copyright (c) 2010 Claudio Jeker <claudio@openbsd.org>
struct pppac_softc {
struct ifnet sc_if;
- unsigned int sc_dead; /* [N] */
dev_t sc_dev; /* [I] */
LIST_ENTRY(pppac_softc)
sc_entry; /* [K] */
int s;
NET_LOCK();
- sc->sc_dead = 1;
CLR(ifp->if_flags, IFF_RUNNING);
NET_UNLOCK();
+ if_detach(ifp);
+
s = splhigh();
klist_invalidate(&sc->sc_rsel.si_note);
klist_invalidate(&sc->sc_wsel.si_note);
splx(s);
- if_detach(ifp);
-
pool_put(&pipex_session_pool, sc->sc_multicast_session);
NET_LOCK();
pipex_destroy_all_sessions(sc);
static int
pppac_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
- struct pppac_softc *sc = ifp->if_softc;
/* struct ifreq *ifr = (struct ifreq *)data; */
int error = 0;
- if (sc->sc_dead)
- return (ENXIO);
-
switch (cmd) {
case SIOCSIFADDR:
SET(ifp->if_flags, IFF_UP); /* XXX cry cry */