420-indicate-features.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. --- 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. struct hapd_global {
  10. void **drv_priv;
  11. @@ -692,7 +692,7 @@ int main(int argc, char *argv[])
  12. wpa_supplicant_event = hostapd_wpa_event;
  13. wpa_supplicant_event_global = hostapd_wpa_event_global;
  14. for (;;) {
  15. - c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q");
  16. + c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::");
  17. if (c < 0)
  18. break;
  19. switch (c) {
  20. @@ -729,6 +729,8 @@ int main(int argc, char *argv[])
  21. break;
  22. #endif /* CONFIG_DEBUG_LINUX_TRACING */
  23. case 'v':
  24. + if (optarg)
  25. + exit(!has_feature(optarg));
  26. show_version();
  27. exit(1);
  28. case 'g':
  29. --- a/wpa_supplicant/main.c
  30. +++ b/wpa_supplicant/main.c
  31. @@ -12,6 +12,7 @@
  32. #endif /* __linux__ */
  33. #include "common.h"
  34. +#include "build_features.h"
  35. #include "crypto/crypto.h"
  36. #include "fst/fst.h"
  37. #include "wpa_supplicant_i.h"
  38. @@ -203,7 +204,7 @@ int main(int argc, char *argv[])
  39. for (;;) {
  40. c = getopt(argc, argv,
  41. - "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuvW");
  42. + "b:Bc:C:D:de:f:g:G:hH:i:I:KLMm:No:O:p:P:qsTtuv::W");
  43. if (c < 0)
  44. break;
  45. switch (c) {
  46. @@ -306,8 +307,12 @@ int main(int argc, char *argv[])
  47. break;
  48. #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */
  49. case 'v':
  50. - printf("%s\n", wpa_supplicant_version);
  51. - exitcode = 0;
  52. + if (optarg) {
  53. + exitcode = !has_feature(optarg);
  54. + } else {
  55. + printf("%s\n", wpa_supplicant_version);
  56. + exitcode = 0;
  57. + }
  58. goto out;
  59. case 'W':
  60. params.wait_for_monitor++;