From: Jouni Malinen Date: Sat, 31 May 2014 14:15:41 +0000 (+0300) Subject: tests: Verify double DISABLE on hostapd with multi-BSS configuration X-Git-Tag: hostap_2_2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de93da914fb18976b32f9b189e22f0aface0646b;p=thirdparty%2Fhostap.git tests: Verify double DISABLE on hostapd with multi-BSS configuration This used to result in a segmentation fault due to use of freed memory (mismatch in pointer lifetime between hostapd.c and driver_nl80211.c). Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_ap_dynamic.py b/tests/hwsim/test_ap_dynamic.py index 9820580dc..ffce86fd1 100644 --- a/tests/hwsim/test_ap_dynamic.py +++ b/tests/hwsim/test_ap_dynamic.py @@ -314,3 +314,16 @@ def test_ap_enable_disable_reenable(dev, apdev): ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"]) if ev is None: raise Exception("STA connect event timed out") + +def test_ap_double_disable(dev, apdev): + """Double DISABLE regression test""" + hostapd.add_bss('phy3', apdev[0]['ifname'], 'bss-1.conf') + hostapd.add_bss('phy3', apdev[0]['ifname'] + '-2', 'bss-2.conf') + hapd = hostapd.Hostapd(apdev[0]['ifname']) + hapd.disable() + if "FAIL" not in hapd.request("DISABLE"): + raise Exception("Second DISABLE accepted unexpectedly") + hapd.enable() + hapd.disable() + if "FAIL" not in hapd.request("DISABLE"): + raise Exception("Second DISABLE accepted unexpectedly")