blob: 3b28b6e75247dcdf6dae7c5de003334ecaafa179 [file] [log] [blame]
developer29c4d2d2022-12-26 19:41:22 +08001--- a/hostapd/main.c
2+++ b/hostapd/main.c
3@@ -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;
developer8bff6472023-07-17 11:11:44 +080012@@ -786,7 +786,7 @@ int main(int argc, char *argv[])
developer29c4d2d2022-12-26 19:41:22 +080013 wpa_supplicant_event = hostapd_wpa_event;
14 wpa_supplicant_event_global = hostapd_wpa_event_global;
15 for (;;) {
16- 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::");
18 if (c < 0)
19 break;
20 switch (c) {
developer8bff6472023-07-17 11:11:44 +080021@@ -823,6 +823,8 @@ int main(int argc, char *argv[])
developer29c4d2d2022-12-26 19:41:22 +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);
29 case 'g':
30--- 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"
37 #include "crypto/crypto.h"
38 #include "fst/fst.h"
39 #include "wpa_supplicant_i.h"
developerdfb50982023-09-11 13:34:36 +080040@@ -202,7 +203,7 @@ int main(int argc, char *argv[])
developer29c4d2d2022-12-26 19:41:22 +080041
42 for (;;) {
43 c = getopt(argc, argv,
developerdfb50982023-09-11 13:34:36 +080044- "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuvW");
45+ "b:Bc:C:D:de:f:g:G:hi:I:KLMm:No:O:p:P:qsTtuv::W");
developer29c4d2d2022-12-26 19:41:22 +080046 if (c < 0)
47 break;
48 switch (c) {
developerdfb50982023-09-11 13:34:36 +080049@@ -302,8 +303,12 @@ int main(int argc, char *argv[])
developer29c4d2d2022-12-26 19:41:22 +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++;