5 #include "utils/common.h"
6 #include "utils/eloop.h"
7 +#include "utils/build_features.h"
8 #include "crypto/random.h"
9 #include "crypto/tls.h"
10 #include "common/version.h"
11 @@ -551,7 +552,7 @@ int main(int argc, char *argv[])
13 wpa_supplicant_event = hostapd_wpa_event;
15 - c = getopt(argc, argv, "Bde:f:hKP:tv");
16 + c = getopt(argc, argv, "Bde:f:hKP:tv::");
20 @@ -583,6 +584,8 @@ int main(int argc, char *argv[])
21 wpa_debug_timestamp++;
25 + exit(!has_feature(optarg));
29 --- a/wpa_supplicant/main.c
30 +++ b/wpa_supplicant/main.c
32 #endif /* __linux__ */
35 +#include "build_features.h"
36 #include "wpa_supplicant_i.h"
39 @@ -140,7 +141,7 @@ int main(int argc, char *argv[])
40 wpa_supplicant_fd_workaround();
43 - c = getopt(argc, argv, "b:Bc:C:D:de:f:g:hH:i:KLNo:O:p:P:qstuvW");
44 + c = getopt(argc, argv, "b:Bc:C:D:de:f:g:hH:i:KLNo:O:p:P:qstuv::W");
48 @@ -227,8 +228,12 @@ int main(int argc, char *argv[])
50 #endif /* CONFIG_DBUS */
52 - printf("%s\n", wpa_supplicant_version);
55 + exitcode = !has_feature(optarg);
57 + printf("%s\n", wpa_supplicant_version);
62 params.wait_for_monitor++;
64 +++ b/src/utils/build_features.h
66 +#ifndef BUILD_FEATURES_H
67 +#define BUILD_FEATURES_H
69 +static inline int has_feature(const char *feat)
71 +#ifdef IEEE8021X_EAPOL
72 + if (!strcmp(feat, "eap"))
76 + if (!strcmp(feat, "11n"))
82 +#endif /* BUILD_FEATURES_H */