From: Jouni Malinen Date: Sun, 22 May 2016 15:08:55 +0000 (+0300) Subject: nl80211: Add TEST_FAIL() to nl80211_set_mac_addr() X-Git-Tag: hostap_2_6~467 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9ce3e61091c93a065a15e089b101cc85b5582d65;p=thirdparty%2Fhostap.git nl80211: Add TEST_FAIL() to nl80211_set_mac_addr() This makes it easier to test some error paths in wpa_supplicant. Signed-off-by: Jouni Malinen --- diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index b4135cc54..12a417b42 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -8304,6 +8304,9 @@ static int nl80211_set_mac_addr(void *priv, const u8 *addr) struct wpa_driver_nl80211_data *drv = bss->drv; int new_addr = addr != NULL; + if (TEST_FAIL()) + return -1; + if (!addr) addr = drv->perm_addr;