]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make hostapd_config_fill() easier to auto indent
authorJouni Malinen <j@w1.fi>
Mon, 22 Mar 2021 09:33:16 +0000 (11:33 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 22 Mar 2021 09:52:51 +0000 (11:52 +0200)
The conditional compilation block with only the opening brace included
in two variants was messing up auto indentation in emacs. Work around
this by defining the maximum value conditionally while leave the if
block outside any conditional building rules.

Signed-off-by: Jouni Malinen <j@w1.fi>
hostapd/config_file.c

index d73a737821b2f9fc205da392a3f245925a03084f..2347df3f764bc0d01bcb29b8bd9ba7a155f2d3c3 100644 (file)
@@ -2458,12 +2458,13 @@ static int hostapd_config_fill(struct hostapd_config *conf,
                bss->ieee802_1x = atoi(pos);
        } else if (os_strcmp(buf, "eapol_version") == 0) {
                int eapol_version = atoi(pos);
-
 #ifdef CONFIG_MACSEC
-               if (eapol_version < 1 || eapol_version > 3) {
+               int max_ver = 3;
 #else /* CONFIG_MACSEC */
-               if (eapol_version < 1 || eapol_version > 2) {
+               int max_ver = 2;
 #endif /* CONFIG_MACSEC */
+
+               if (eapol_version < 1 || eapol_version > max_ver) {
                        wpa_printf(MSG_ERROR,
                                   "Line %d: invalid EAPOL version (%d): '%s'.",
                                   line, eapol_version, pos);