diff options
author | Damien Bergamini <damien@cvs.openbsd.org> | 2006-12-03 16:39:14 +0000 |
---|---|---|
committer | Damien Bergamini <damien@cvs.openbsd.org> | 2006-12-03 16:39:14 +0000 |
commit | 5e6889f6ab2718335292ee71908c9ddd57a6ae84 (patch) | |
tree | c1180ca4351e4227dd2e692b127f0e73df4c747f /sys | |
parent | e80be550edadedd59814b011a900b1b84a8688b0 (diff) |
fix handling of the SIOCS80211CHANNEL ioctl in monitor mode:
don't call xxx_set_chan() if the interface is not up&running.
patch from Steffen Schuetz (st dot sch at gmx dot net) with
minor modifications by me.
closes kernel/5313
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/rt2560.c | 6 | ||||
-rw-r--r-- | sys/dev/ic/rt2661.c | 9 | ||||
-rw-r--r-- | sys/dev/usb/if_ral.c | 6 | ||||
-rw-r--r-- | sys/dev/usb/if_rum.c | 9 |
4 files changed, 20 insertions, 10 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c index ce98c259ca4..30fa917b646 100644 --- a/sys/dev/ic/rt2560.c +++ b/sys/dev/ic/rt2560.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2560.c,v 1.27 2006/11/26 11:14:18 deraadt Exp $ */ +/* $OpenBSD: rt2560.c,v 1.28 2006/12/03 16:39:13 damien Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -2049,7 +2049,9 @@ rt2560_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ieee80211_ioctl(ifp, cmd, data); if (error == ENETRESET && ic->ic_opmode == IEEE80211_M_MONITOR) { - rt2560_set_chan(sc, ic->ic_ibss_chan); + if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == + (IFF_UP | IFF_RUNNING)) + rt2560_set_chan(sc, ic->ic_ibss_chan); error = 0; } break; diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c index d1d48462e3b..49a571e2dba 100644 --- a/sys/dev/ic/rt2661.c +++ b/sys/dev/ic/rt2661.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rt2661.c,v 1.32 2006/11/26 11:14:18 deraadt Exp $ */ +/* $OpenBSD: rt2661.c,v 1.33 2006/12/03 16:39:13 damien Exp $ */ /*- * Copyright (c) 2006 @@ -257,7 +257,8 @@ rt2661_attach(void *xsc, int id) if (sc->rf_rev == RT2661_RF_5225 || sc->rf_rev == RT2661_RF_5325) { /* set supported .11a rates */ - ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a; + ic->ic_sup_rates[IEEE80211_MODE_11A] = + ieee80211_std_rateset_11a; /* set supported .11a channels */ for (i = 36; i <= 64; i += 4) { @@ -1894,7 +1895,9 @@ rt2661_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ieee80211_ioctl(ifp, cmd, data); if (error == ENETRESET && ic->ic_opmode == IEEE80211_M_MONITOR) { - rt2661_set_chan(sc, ic->ic_ibss_chan); + if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == + (IFF_UP | IFF_RUNNING)) + rt2661_set_chan(sc, ic->ic_ibss_chan); error = 0; } break; diff --git a/sys/dev/usb/if_ral.c b/sys/dev/usb/if_ral.c index b1668ee2541..fd2a75ba08e 100644 --- a/sys/dev/usb/if_ral.c +++ b/sys/dev/usb/if_ral.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ral.c,v 1.85 2006/12/03 16:16:58 damien Exp $ */ +/* $OpenBSD: if_ral.c,v 1.86 2006/12/03 16:39:13 damien Exp $ */ /*- * Copyright (c) 2005, 2006 @@ -1356,7 +1356,9 @@ ural_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ieee80211_ioctl(ifp, cmd, data); if (error == ENETRESET && ic->ic_opmode == IEEE80211_M_MONITOR) { - ural_set_chan(sc, ic->ic_ibss_chan); + if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == + (IFF_UP | IFF_RUNNING)) + ural_set_chan(sc, ic->ic_ibss_chan); error = 0; } break; diff --git a/sys/dev/usb/if_rum.c b/sys/dev/usb/if_rum.c index 58472d16067..00e6e30e32e 100644 --- a/sys/dev/usb/if_rum.c +++ b/sys/dev/usb/if_rum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_rum.c,v 1.46 2006/12/03 16:16:58 damien Exp $ */ +/* $OpenBSD: if_rum.c,v 1.47 2006/12/03 16:39:13 damien Exp $ */ /*- * Copyright (c) 2005, 2006 Damien Bergamini <damien.bergamini@free.fr> @@ -343,7 +343,8 @@ USB_ATTACH(rum) if (sc->rf_rev == RT2573_RF_5225 || sc->rf_rev == RT2573_RF_5226) { /* set supported .11a rates */ - ic->ic_sup_rates[IEEE80211_MODE_11A] = ieee80211_std_rateset_11a; + ic->ic_sup_rates[IEEE80211_MODE_11A] = + ieee80211_std_rateset_11a; /* set supported .11a channels */ for (i = 34; i <= 46; i += 4) { @@ -1349,7 +1350,9 @@ rum_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) error = ieee80211_ioctl(ifp, cmd, data); if (error == ENETRESET && ic->ic_opmode == IEEE80211_M_MONITOR) { - rum_set_chan(sc, ic->ic_ibss_chan); + if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) == + (IFF_UP | IFF_RUNNING)) + rum_set_chan(sc, ic->ic_ibss_chan); error = 0; } break; |