madwifi: fix crash on ad-hoc interface init
authorFelix Fietkau <nbd@openwrt.org>
Tue, 5 Aug 2008 20:53:39 +0000 (20:53 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 5 Aug 2008 20:53:39 +0000 (20:53 +0000)
SVN-Revision: 12161

package/madwifi/patches/378-adhoc_crash_fix.patch [new file with mode: 0644]

diff --git a/package/madwifi/patches/378-adhoc_crash_fix.patch b/package/madwifi/patches/378-adhoc_crash_fix.patch
new file mode 100644 (file)
index 0000000..e8b4c22
--- /dev/null
@@ -0,0 +1,14 @@
+--- a/net80211/ieee80211_input.c
++++ b/net80211/ieee80211_input.c
+@@ -3522,6 +3522,11 @@
+               if (ic->ic_flags & IEEE80211_F_SCAN) {
+                       ieee80211_add_scan(vap, &scan, wh, subtype, rssi, rtsf);
+               }
++
++              /* stop processing if the bss channel is not set up yet */
++              if (!ic->ic_bsschan || ic->ic_bsschan == IEEE80211_CHAN_ANYC)
++                      break;
++
+               /* NB: Behavior of WDS-Link and Ad-Hoc is very similar here:
+                * When we receive a beacon that belongs to the AP that we're
+                * connected to, use it to refresh the local node info.