Add patch:
- 001-PASN-Fix-the-compilation-errors-without-CONFIG_PASN.patch
Manually edit patches:
- 110-mbedtls-TLS-crypto-option-initial-port.patch
- 190-hostapd-Fix-hostapd-crash-if-setup-a-iface-with-.patch
- 191-hostapd-add-support-for-specifying-the-link-id-in-th.patch
- 220-indicate-features.patch
- 360-acs_retry.patch
-> Remove the extra check for -EBUSY (see below) because the code we
want to skip is now already guarded by:
https://git.w1.fi/cgit/hostap/commit/?id=af6473761f07ae4f13ef228dec618ca62faf6ef4
```
+ if (ret == -EBUSY)
+ goto fail;
```
- 341-mesh-ctrl-iface-channel-switch.patch
- 600-ubus_support.patch
- 601-ucode_support.patch
-> The patch had this and similar changes:
```
- if (os_strcmp(drv->first_bss->ifname, ifname) != 0) {
+ if (drv->first_bss->ifindex != ifi->ifi_index) {
```
Those changes should be unnecessary due to the commit:
https://git.w1.fi/cgit/hostap/commit/?id=2bf6d85963b9857b411b57cc7949e30ee2cb1216
- 780-Implement-APuP-Access-Point-Micro-Peering.patch
-> Needs adjustement because of Enhanced Privacy Protection (EPP):
https://git.w1.fi/cgit/hostap/commit/?id=1e13ee9c382a5d88c4bb0ffdfaf434fbb31123f3
Remove patch:
- 030-Revert-nl80211-Accept-a-global-nl80211-event-to-a-br.patch
- 060-nl80211-fix-reporting-spurious-frame-events.patch
-> https://git.w1.fi/cgit/hostap/commit/?id=ca266cc24d8705eb1a2a0857ad326e48b1408b20
- 190-hostapd-Fix-hostapd-crash-if-setup-a-iface-with-.patch
-> https://git.w1.fi/cgit/hostap/commit/?id=e275c3dc70e1c2947e02e43aeee6c4f9975c3dc7
- 192-nl80211-cancel-scans-whenever-the-first-bss-is-remov.patch
-> https://git.w1.fi/cgit/hostap/commit/?id=5ce1d41803866782bbd96d575f53d43358a20a2e
- 350-nl80211_del_beacon_bss.patch
-> https://git.w1.fi/cgit/hostap/commit/?id=b777ecb16274235974edb5c1dfcea6abab25f6c4
Tested-By: Daniel Pawlik <pawlik.dan@gmail.com>
Co-developed-by: Agustin Lorenzo <agustin.lorenzo@thinco.es>
Link: https://github.com/openwrt/openwrt/pull/20912
Signed-off-by: Nick Hainke <vincent@systemli.org>
216 lines
6.7 KiB
Diff
216 lines
6.7 KiB
Diff
From: Felix Fietkau <nbd@openwrt.org>
|
|
Date: Mon, 20 Feb 2012 23:41:52 +0000
|
|
Subject: [PATCH] hostapd: add configurable debug message minimum priority to
|
|
cut down on bloat generated by excessive debug messages
|
|
|
|
--- a/src/utils/wpa_debug.c
|
|
+++ b/src/utils/wpa_debug.c
|
|
@@ -220,7 +220,7 @@ void wpa_debug_close_linux_tracing(void)
|
|
*
|
|
* Note: New line '\n' is added to the end of the text when printing to stdout.
|
|
*/
|
|
-void wpa_printf(int level, const char *fmt, ...)
|
|
+void _wpa_printf(int level, const char *fmt, ...)
|
|
{
|
|
va_list ap;
|
|
|
|
@@ -269,7 +269,7 @@ void wpa_printf(int level, const char *f
|
|
}
|
|
|
|
|
|
-static void _wpa_hexdump(int level, const char *title, const u8 *buf,
|
|
+void _wpa_hexdump(int level, const char *title, const u8 *buf,
|
|
size_t len, int show, int only_syslog)
|
|
{
|
|
size_t i;
|
|
@@ -396,19 +396,7 @@ static void _wpa_hexdump(int level, cons
|
|
#endif /* CONFIG_ANDROID_LOG */
|
|
}
|
|
|
|
-void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
|
|
-{
|
|
- _wpa_hexdump(level, title, buf, len, 1, 0);
|
|
-}
|
|
-
|
|
-
|
|
-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len)
|
|
-{
|
|
- _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys, 0);
|
|
-}
|
|
-
|
|
-
|
|
-static void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
|
+void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
|
size_t len, int show)
|
|
{
|
|
size_t i, llen;
|
|
@@ -521,20 +509,6 @@ file_done:
|
|
}
|
|
|
|
|
|
-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
|
- size_t len)
|
|
-{
|
|
- _wpa_hexdump_ascii(level, title, buf, len, 1);
|
|
-}
|
|
-
|
|
-
|
|
-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
|
|
- size_t len)
|
|
-{
|
|
- _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
|
|
-}
|
|
-
|
|
-
|
|
#ifdef CONFIG_DEBUG_FILE
|
|
static char *last_path = NULL;
|
|
#endif /* CONFIG_DEBUG_FILE */
|
|
@@ -658,7 +632,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_
|
|
}
|
|
|
|
|
|
-void wpa_msg(void *ctx, int level, const char *fmt, ...)
|
|
+void _wpa_msg(void *ctx, int level, const char *fmt, ...)
|
|
{
|
|
va_list ap;
|
|
char *buf;
|
|
@@ -696,7 +670,7 @@ void wpa_msg(void *ctx, int level, const
|
|
}
|
|
|
|
|
|
-void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
|
|
+void _wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
|
|
{
|
|
va_list ap;
|
|
char *buf;
|
|
--- a/src/utils/wpa_debug.h
|
|
+++ b/src/utils/wpa_debug.h
|
|
@@ -76,6 +76,17 @@ void wpa_debug_close_file(void);
|
|
void wpa_debug_setup_stdout(void);
|
|
void wpa_debug_stop_log(void);
|
|
|
|
+/* internal */
|
|
+void _wpa_hexdump(int level, const char *title, const u8 *buf,
|
|
+ size_t len, int show, int only_syslog);
|
|
+void _wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
|
+ size_t len, int show);
|
|
+extern int wpa_debug_show_keys;
|
|
+
|
|
+#ifndef CONFIG_MSG_MIN_PRIORITY
|
|
+#define CONFIG_MSG_MIN_PRIORITY 0
|
|
+#endif
|
|
+
|
|
/**
|
|
* wpa_debug_printf_timestamp - Print timestamp for debug output
|
|
*
|
|
@@ -96,9 +107,15 @@ void wpa_debug_print_timestamp(void);
|
|
*
|
|
* Note: New line '\n' is added to the end of the text when printing to stdout.
|
|
*/
|
|
-void wpa_printf(int level, const char *fmt, ...)
|
|
+void _wpa_printf(int level, const char *fmt, ...)
|
|
PRINTF_FORMAT(2, 3);
|
|
|
|
+#define wpa_printf(level, ...) \
|
|
+ do { \
|
|
+ if (level >= CONFIG_MSG_MIN_PRIORITY) \
|
|
+ _wpa_printf(level, __VA_ARGS__); \
|
|
+ } while(0)
|
|
+
|
|
/**
|
|
* wpa_hexdump - conditional hex dump
|
|
* @level: priority level (MSG_*) of the message
|
|
@@ -110,7 +127,13 @@ PRINTF_FORMAT(2, 3);
|
|
* output may be directed to stdout, stderr, and/or syslog based on
|
|
* configuration. The contents of buf is printed out has hex dump.
|
|
*/
|
|
-void wpa_hexdump(int level, const char *title, const void *buf, size_t len);
|
|
+static inline void wpa_hexdump(int level, const char *title, const void *buf, size_t len)
|
|
+{
|
|
+ if (level < CONFIG_MSG_MIN_PRIORITY)
|
|
+ return;
|
|
+
|
|
+ _wpa_hexdump(level, title, buf, len, 1, 1);
|
|
+}
|
|
|
|
static inline void wpa_hexdump_buf(int level, const char *title,
|
|
const struct wpabuf *buf)
|
|
@@ -132,7 +155,13 @@ static inline void wpa_hexdump_buf(int l
|
|
* like wpa_hexdump(), but by default, does not include secret keys (passwords,
|
|
* etc.) in debug output.
|
|
*/
|
|
-void wpa_hexdump_key(int level, const char *title, const void *buf, size_t len);
|
|
+static inline void wpa_hexdump_key(int level, const char *title, const u8 *buf, size_t len)
|
|
+{
|
|
+ if (level < CONFIG_MSG_MIN_PRIORITY)
|
|
+ return;
|
|
+
|
|
+ _wpa_hexdump(level, title, buf, len, wpa_debug_show_keys, 1);
|
|
+}
|
|
|
|
static inline void wpa_hexdump_buf_key(int level, const char *title,
|
|
const struct wpabuf *buf)
|
|
@@ -154,8 +183,14 @@ static inline void wpa_hexdump_buf_key(i
|
|
* the hex numbers and ASCII characters (for printable range) are shown. 16
|
|
* bytes per line will be shown.
|
|
*/
|
|
-void wpa_hexdump_ascii(int level, const char *title, const void *buf,
|
|
- size_t len);
|
|
+static inline void wpa_hexdump_ascii(int level, const char *title,
|
|
+ const u8 *buf, size_t len)
|
|
+{
|
|
+ if (level < CONFIG_MSG_MIN_PRIORITY)
|
|
+ return;
|
|
+
|
|
+ _wpa_hexdump_ascii(level, title, buf, len, 1);
|
|
+}
|
|
|
|
/**
|
|
* wpa_hexdump_ascii_key - conditional hex dump, hide keys
|
|
@@ -171,8 +206,14 @@ void wpa_hexdump_ascii(int level, const
|
|
* bytes per line will be shown. This works like wpa_hexdump_ascii(), but by
|
|
* default, does not include secret keys (passwords, etc.) in debug output.
|
|
*/
|
|
-void wpa_hexdump_ascii_key(int level, const char *title, const void *buf,
|
|
- size_t len);
|
|
+static inline void wpa_hexdump_ascii_key(int level, const char *title,
|
|
+ const u8 *buf, size_t len)
|
|
+{
|
|
+ if (level < CONFIG_MSG_MIN_PRIORITY)
|
|
+ return;
|
|
+
|
|
+ _wpa_hexdump_ascii(level, title, buf, len, wpa_debug_show_keys);
|
|
+}
|
|
|
|
/*
|
|
* wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce
|
|
@@ -209,7 +250,12 @@ void wpa_hexdump_ascii_key(int level, co
|
|
*
|
|
* Note: New line '\n' is added to the end of the text when printing to stdout.
|
|
*/
|
|
-void wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4);
|
|
+void _wpa_msg(void *ctx, int level, const char *fmt, ...) PRINTF_FORMAT(3, 4);
|
|
+#define wpa_msg(ctx, level, ...) \
|
|
+ do { \
|
|
+ if (level >= CONFIG_MSG_MIN_PRIORITY) \
|
|
+ _wpa_msg(ctx, level, __VA_ARGS__); \
|
|
+ } while(0)
|
|
|
|
/**
|
|
* wpa_msg_ctrl - Conditional printf for ctrl_iface monitors
|
|
@@ -223,8 +269,13 @@ void wpa_msg(void *ctx, int level, const
|
|
* attached ctrl_iface monitors. In other words, it can be used for frequent
|
|
* events that do not need to be sent to syslog.
|
|
*/
|
|
-void wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
|
|
+void _wpa_msg_ctrl(void *ctx, int level, const char *fmt, ...)
|
|
PRINTF_FORMAT(3, 4);
|
|
+#define wpa_msg_ctrl(ctx, level, ...) \
|
|
+ do { \
|
|
+ if (level >= CONFIG_MSG_MIN_PRIORITY) \
|
|
+ _wpa_msg_ctrl(ctx, level, __VA_ARGS__); \
|
|
+ } while(0)
|
|
|
|
/**
|
|
* wpa_msg_global - Global printf for ctrl_iface monitors
|