]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
PASN: Avoid unreachable code with CONFIG_NO_RADIUS
authorJouni Malinen <j@w1.fi>
Sun, 28 Feb 2021 09:37:09 +0000 (11:37 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 28 Feb 2021 09:37:47 +0000 (11:37 +0200)
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 <j@w1.fi>
src/ap/ieee802_11.c

index 40d4a3381786e133797ab67b50633764dd82a44b..1c01241bcf3ab9b4b568568bd8fcbf56b1104dcb 100644 (file)
@@ -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 */