Subject: Re: kern/32168
To: None <skrll@netbsd.org, gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: Nick Hudson <nick.hudson@dsl.pipex.com>
List: netbsd-bugs
Date: 11/28/2005 14:18:02
The following reply was made to PR kern/32168; it has been noted by GNATS.
From: Nick Hudson <nick.hudson@dsl.pipex.com>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: kern/32168
Date: Mon, 28 Nov 2005 14:17:16 +0000
--Boundary-00=_sFxiDzJ9AcwUdsP
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Please try this patch. My change to fix pr32143 wasn't quite correct.
Thanks,
Nick
--Boundary-00=_sFxiDzJ9AcwUdsP
Content-Type: text/x-diff;
charset="us-ascii";
name="if_iwi.c.diff.pr32168"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="if_iwi.c.diff.pr32168"
Index: dev/pci/if_iwi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_iwi.c,v
retrieving revision 1.41
diff -u -p -u -r1.41 if_iwi.c
--- dev/pci/if_iwi.c 26 Nov 2005 07:42:10 -0000 1.41
+++ dev/pci/if_iwi.c 28 Nov 2005 14:15:18 -0000
@@ -1884,9 +1884,12 @@ iwi_get_radio(struct iwi_softc *sc, int
static int
iwi_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
+#define IS_RUNNING(ifp) \
+ ((ifp->if_flags & IFF_UP) && (ifp->if_flags & IFF_RUNNING))
+
struct iwi_softc *sc = ifp->if_softc;
struct ieee80211com *ic = &sc->sc_ic;
- struct ifreq *ifr;
+ struct ifreq *ifr = (struct ifreq *)data;
int s, error = 0;
s = splnet();
@@ -1902,13 +1905,23 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd,
}
break;
+ case SIOCADDMULTI:
+ case SIOCDELMULTI:
+ error = (cmd == SIOCADDMULTI) ?
+ ether_addmulti(ifr, &sc->sc_ec) :
+ ether_delmulti(ifr, &sc->sc_ec);
+ if (error == ENETRESET) {
+ if (ifp->if_flags & IFF_RUNNING)
+ iwi_init(ifp);
+ error = 0;
+ }
+ break;
+
case SIOCGTABLE0:
- ifr = (struct ifreq *)data;
error = iwi_get_table0(sc, (uint32_t *)ifr->ifr_data);
break;
case SIOCGRADIO:
- ifr = (struct ifreq *)data;
error = iwi_get_radio(sc, (int *)ifr->ifr_data);
break;
@@ -1917,7 +1930,6 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd,
if ((error = suser(curproc->p_ucred, &curproc->p_acflag)) != 0)
break;
- ifr = (struct ifreq *)data;
error = iwi_cache_firmware(sc, ifr->ifr_data);
break;
@@ -1933,18 +1945,18 @@ iwi_ioctl(struct ifnet *ifp, u_long cmd,
default:
error = ieee80211_ioctl(&sc->sc_ic, cmd, data);
- }
- if (error == ENETRESET) {
- if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) ==
- (IFF_UP | IFF_RUNNING) &&
- (ic->ic_roaming != IEEE80211_ROAMING_MANUAL))
- iwi_init(ifp);
- error = 0;
+ if (error == ENETRESET) {
+ if (IS_RUNNING(ifp) &&
+ (ic->ic_roaming != IEEE80211_ROAMING_MANUAL))
+ iwi_init(ifp);
+ error = 0;
+ }
}
splx(s);
return error;
+#undef IS_RUNNING
}
static void
--Boundary-00=_sFxiDzJ9AcwUdsP--