summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2017-12-07 14:12:39 +0000
committerstsp <stsp@openbsd.org>2017-12-07 14:12:39 +0000
commit6c1bddc001a9e9ebdeded168d1976a2f0eba6d61 (patch)
tree0b162573ebe750c7b5e5861ecae49790ff7e0cb7
parentSet the correct ENCAPSULATION_MODE when doing NAT-T. (diff)
downloadwireguard-openbsd-6c1bddc001a9e9ebdeded168d1976a2f0eba6d61.tar.xz
wireguard-openbsd-6c1bddc001a9e9ebdeded168d1976a2f0eba6d61.zip
Make iwm_newstate() recover from state transition errors.
On error, we now schedule the init task which will whack the interface when it gets to run, which prevents the driver from stalling in such situations. ok phessler@
-rw-r--r--sys/dev/pci/if_iwm.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/pci/if_iwm.c b/sys/dev/pci/if_iwm.c
index cf1749b1010..036ecf46eef 100644
--- a/sys/dev/pci/if_iwm.c
+++ b/sys/dev/pci/if_iwm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwm.c,v 1.217 2017/10/26 15:00:28 mpi Exp $ */
+/* $OpenBSD: if_iwm.c,v 1.218 2017/12/07 14:12:39 stsp Exp $ */
/*
* Copyright (c) 2014, 2016 genua gmbh <info@genua.de>
@@ -6056,8 +6056,12 @@ iwm_newstate_task(void *psc)
}
out:
- if (err == 0 && (sc->sc_flags & IWM_FLAG_SHUTDOWN) == 0)
- sc->sc_newstate(ic, nstate, arg);
+ if ((sc->sc_flags & IWM_FLAG_SHUTDOWN) == 0) {
+ if (err)
+ task_add(systq, &sc->init_task);
+ else
+ sc->sc_newstate(ic, nstate, arg);
+ }
refcnt_rele_wake(&sc->task_refs);
splx(s);
}