From: damien Date: Wed, 27 Aug 2008 09:28:38 +0000 (+0000) Subject: the firmware is responsible for sending management frames, but X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=80d3da37ca8fcf6baa10c4ddd32b55ce9cb8c4bf;p=openbsd the firmware is responsible for sending management frames, but since we pass received management frames to net80211, net80211 may send replies (like deauth/disassoc), so we just call IF_PURGE(&ic->ic_mgtq) in {ipw,iwi}_start just to be on the safe side of things (so we don't leak mbufs). --- diff --git a/sys/dev/pci/if_ipw.c b/sys/dev/pci/if_ipw.c index 2aa61f339e5..dec88cbf888 100644 --- a/sys/dev/pci/if_ipw.c +++ b/sys/dev/pci/if_ipw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ipw.c,v 1.74 2008/08/27 09:05:03 damien Exp $ */ +/* $OpenBSD: if_ipw.c,v 1.75 2008/08/27 09:28:38 damien Exp $ */ /*- * Copyright (c) 2004-2008 @@ -1301,10 +1301,11 @@ ipw_start(struct ifnet *ifp) struct ieee80211_node *ni; struct mbuf *m; - if (ic->ic_state != IEEE80211_S_RUN) - return; - for (;;) { + IF_PURGE(&ic->ic_mgtq); + + if (ic->ic_state != IEEE80211_S_RUN) + return; IFQ_POLL(&ifp->if_snd, m); if (m == NULL) break; diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c index 32cd3a77b38..09ff28a340d 100644 --- a/sys/dev/pci/if_iwi.c +++ b/sys/dev/pci/if_iwi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwi.c,v 1.88 2008/08/27 09:05:03 damien Exp $ */ +/* $OpenBSD: if_iwi.c,v 1.89 2008/08/27 09:28:38 damien Exp $ */ /*- * Copyright (c) 2004-2006 @@ -1416,10 +1416,11 @@ iwi_start(struct ifnet *ifp) struct mbuf *m0; struct ieee80211_node *ni; - if (ic->ic_state != IEEE80211_S_RUN) - return; - for (;;) { + IF_PURGE(&ic->ic_mgtq); + + if (ic->ic_state != IEEE80211_S_RUN) + return; IFQ_POLL(&ifp->if_snd, m0); if (m0 == NULL) break;