From: Jouni Malinen Date: Sun, 28 Feb 2021 09:37:09 +0000 (+0200) Subject: PASN: Avoid unreachable code with CONFIG_NO_RADIUS X-Git-Tag: hostap_2_10~507 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8211e1e75e838ea5eb1719ccf2c5a642ec854e2;p=thirdparty%2Fhostap.git PASN: Avoid unreachable code with CONFIG_NO_RADIUS There is no point in trying to build in rest of this function if in the middle of it the CONFIG_NO_RADIUS case would unconditionally fail. Simply make all of this be conditional on that build parameter not being set to make things easier for static analyzers. Signed-off-by: Jouni Malinen --- diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 40d4a3381..1c01241bc 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -2656,6 +2656,10 @@ fail: static int pasn_wd_handle_fils(struct hostapd_data *hapd, struct sta_info *sta, struct wpabuf *wd) { +#ifdef CONFIG_NO_RADIUS + wpa_printf(MSG_DEBUG, "PASN: FILS: RADIUS is not configured. Fail"); + return -1; +#else /* CONFIG_NO_RADIUS */ struct pasn_data *pasn = sta->pasn; struct pasn_fils_data *fils = &pasn->fils; struct ieee802_11_elems elems; @@ -2740,11 +2744,6 @@ static int pasn_wd_handle_fils(struct hostapd_data *hapd, struct sta_info *sta, FILS_SESSION_LEN); os_memcpy(fils->session, elems.fils_session, FILS_SESSION_LEN); -#ifdef CONFIG_NO_RADIUS - wpa_printf(MSG_DEBUG, "PASN: FILS: RADIUS is not configured. Fail"); - return -1; -#endif /* CONFIG_NO_RADIUS */ - fils_wd = ieee802_11_defrag(&elems, WLAN_EID_EXTENSION, WLAN_EID_EXT_WRAPPED_DATA); @@ -2775,6 +2774,7 @@ static int pasn_wd_handle_fils(struct hostapd_data *hapd, struct sta_info *sta, wpabuf_free(fils_wd); return 0; +#endif /* CONFIG_NO_RADIUS */ } #endif /* CONFIG_FILS */