blob: 12edb6baccbcc1631f0fffc4a2c901b88dbcd966 [file] [log] [blame]
developer4e0da232022-05-09 13:05:53 +08001--- a/hostapd/main.c
2+++ b/hostapd/main.c
developer42b63282022-06-16 13:33:13 +08003@@ -31,7 +31,7 @@
4 #include "config_file.h"
5 #include "eap_register.h"
6 #include "ctrl_iface.h"
7-
8+#include "build_features.h"
9
10 struct hapd_global {
11 void **drv_priv;
12@@ -692,7 +692,7 @@ int main(int argc, char *argv[])
developer4e0da232022-05-09 13:05:53 +080013 wpa_supplicant_event = hostapd_wpa_event;
14 wpa_supplicant_event_global = hostapd_wpa_event_global;
15 for (;;) {
developer42b63282022-06-16 13:33:13 +080016- c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q");
17+ c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::");
developer4e0da232022-05-09 13:05:53 +080018 if (c < 0)
19 break;
20 switch (c) {
developer42b63282022-06-16 13:33:13 +080021@@ -729,6 +729,8 @@ int main(int argc, char *argv[])
developer4e0da232022-05-09 13:05:53 +080022 break;
23 #endif /* CONFIG_DEBUG_LINUX_TRACING */
24 case 'v':
25+ if (optarg)
26+ exit(!has_feature(optarg));
27 show_version();
28 exit(1);
developer42b63282022-06-16 13:33:13 +080029 case 'g':
developer4e0da232022-05-09 13:05:53 +080030--- a/wpa_supplicant/main.c
31+++ b/wpa_supplicant/main.c
32@@ -12,6 +12,7 @@
33 #endif /* __linux__ */
34
35 #include "common.h"
36+#include "build_features.h"
developer42b63282022-06-16 13:33:13 +080037 #include "crypto/crypto.h"
developer4e0da232022-05-09 13:05:53 +080038 #include "fst/fst.h"
39 #include "wpa_supplicant_i.h"
developer42b63282022-06-16 13:33:13 +080040@@ -203,7 +204,7 @@ int main(int argc, char *argv[])
developer4e0da232022-05-09 13:05:53 +080041
42 for (;;) {
43 c = getopt(argc, argv,
44- "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW");
45+ "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuv::W");
46 if (c < 0)
47 break;
48 switch (c) {
developer42b63282022-06-16 13:33:13 +080049@@ -306,8 +307,12 @@ int main(int argc, char *argv[])
developer4e0da232022-05-09 13:05:53 +080050 break;
51 #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
52 case 'v':
53- printf("%s\n", wpa_supplicant_version);
54- exitcode = 0;
55+ if (optarg) {
56+ exitcode = !has_feature(optarg);
57+ } else {
58+ printf("%s\n", wpa_supplicant_version);
59+ exitcode = 0;
60+ }
61 goto out;
62 case 'W':
63 params.wait_for_monitor++;