From b8211e1e75e838ea5eb1719ccf2c5a642ec854e2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 28 Feb 2021 11:37:09 +0200 Subject: [PATCH] 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 --- src/ap/ieee802_11.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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 */