hostapd: Incomplete implementation of the log level (semi-bug)
Nobody has claimed this yet.
- Dominant language
- Makefile
- Stars
- 4.6k
- Forks
- 4k
- Avg merge
- 3d 12h
- Merged PRs (30d)
- 134
Description
A solution (pending PR creation and merging) is described in:
https://github.com/openwrt/packages/issues/26280#issuecomment-3698987647
Hi,
In the current “hostapd” package there is a patch to adapt the tool's logging to Openwrt:
https://github.com/openwrt/openwrt/blob/main/package/network/services/hostapd/patches/410-limit_debug_messages.patch
But this patch is incomplete!
Here the problem:
- The current implementation sends all tool messages to the syslog. This is true regardless of the logging level configured by the
logger_syslog_levelvalue. - Therefore you will see a lot of System Log messages starting with
daemon.notice hostapd(note the "notice" label) regardless thelogger_syslog_level=4by default in the wireless configuration. - Example of verbose messages (using Dawn):
Tue Apr 8 17:44:11 2025 daemon.notice hostapd: phy1-wl0: BEACON-RESP-RX xx:xx:xx:xx:xx:xx 164 04
Tue Apr 8 17:44:11 2025 daemon.notice hostapd: phy1-wl0: BEACON-REQ-TX-STATUS xx:xx:xx:xx:xx:xx 165 ack=1
Tue Apr 8 17:44:11 2025 daemon.notice hostapd: phy1-wl0: BEACON-RESP-RX xx:xx:xx:xx:xx:xx 0 00 [...]
Tue Apr 8 17:44:23 2025 daemon.notice hostapd: phy1-wl0: BEACON-REQ-TX-STATUS xx:xx:xx:xx:xx:xx 167 ack=1
Tue Apr 8 17:44:23 2025 daemon.notice hostapd: phy1-wl0: BEACON-RESP-RX xx:xx:xx:xx:xx:xx 0 00
Tue Apr 8 17:44:24 2025 daemon.notice hostapd: phy1-wl0: BEACON-REQ-TX-STATUS xx:xx:xx:xx:xx:xx 166 ack=1
Tue Apr 8 17:44:24 2025 daemon.notice hostapd: phy1-wl0: BEACON-RESP-RX xx:xx:xx:xx:xx:xx 166 00 [...]
Tue Apr 8 17:44:26 2025 daemon.notice hostapd: phy1-wl0: BEACON-REQ-TX-STATUS xx:xx:xx:xx:xx:xx 169 ack=1
Tue Apr 8 17:44:26 2025 daemon.notice hostapd: phy1-wl0: BEACON-RESP-RX xx:xx:xx:xx:xx:xx 0 00
More or less you'll see about 10~50 lines per minute. A lot of verbose logging!
The root cause is that the hostapd tool is sending the log using the vsyslog() standard C function, and passing to it the debug level:
But the current implementation of Openwrt using logd does not internally filter the system log messages. Therefore, using regular mesh tools you're populating your System Log with hundreds of unnecessary entries.
One solution is to expand the current 410-limit_debug_messages.patch to filter out the messages inside the functions _wpa_printf() and _wpa_msg(). Using the value of the hapd->conf->logger_syslog_level variable.
I hope someone will want to implement it and complete this patch. Without it so many users will continue to suffer from excessive hostapd BEACON-* messages in the System Log.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading package/network/services/hostapd/patches/410-limit_debug_messages.patch and src/utils/wpa_debug.c around vsyslog(), _wpa_printf(), and _wpa_msg(). Compare logger_syslog_level with the emitted messages, then verify that verbose BEACON-* entries are filtered while applicable logs remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100