Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dnsmasq warnings to message table #1243

Merged
merged 2 commits into from
Nov 14, 2021
Merged

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Nov 13, 2021

By submitting this pull request, I confirm the following:

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.

How familiar are you with the codebase?:

10


Add DNSMASQ_WARN message type whenever dnsmasq logs a warning. Also do not flush the message table on reload (but only on restart) so that config-related (i.e. one-time) warnings are not accidentally deleted.

…do not flush the message table on reload (but only on restart) so that config-related (i.e. one-time) warnings are not accidentally deleted.

Signed-off-by: DL6ER <[email protected]>
@DL6ER DL6ER marked this pull request as ready for review November 13, 2021 10:15
@DL6ER DL6ER requested review from yubiuser and PromoFaux November 13, 2021 10:15
@@ -314,6 +314,19 @@ void my_syslog(int priority, const char *format, ...)
fputc('\n', stderr);
}

/* Pi-hole diagnosis system */
if(priority == LOG_WARNING)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is priority set? Is this user-configurable? Is this a dnsmasq option?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want to add WARNING level messages to the message table here. dnsmasq logs quite a few things like warnings, but also more generic information like queries. The priority is hard-coded in the dnsmasq code, some examples:

We want:

my_syslog(LOG_WARNING, _("warning: interface %s does not currently exist"), if_tmp->name);

my_syslog(LOG_WARNING, _("cache size greater than 10000 may cause performance issues, and is unlikely to be useful."));

my_syslog(MS_TFTP | LOG_WARNING, _("warning: %s inaccessible"), daemon->tftp_prefix);

FTL/src/dnsmasq/lease.c

Lines 64 to 66 in 198e7c6

my_syslog(MS_DHCP | LOG_WARNING, _("ignoring invalid line in lease database: %s %s %s %s ..."),
daemon->dhcp_buff3, daemon->dhcp_buff2,
daemon->namebuff, daemon->dhcp_buff);

We don't want:

my_syslog(LOG_INFO, _("started, version %s DNS disabled"), VERSION);

my_syslog(LOG_INFO, _("connected to system DBus"));

my_syslog(LOG_INFO, _("dumping UDP packet %u mask 0x%04x"), ++packet_count, mask);

my_syslog(LOG_INFO, _("pool memory in use %zu, max %zu, allocated %zu"),
blockdata_count * sizeof(struct blockdata),
blockdata_hwm * sizeof(struct blockdata),
blockdata_alloced * sizeof(struct blockdata));

Copy link
Member

@yubiuser yubiuser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woks as intended. See
pi-hole/web#1973 (review)

@DL6ER DL6ER merged commit 827b55a into development Nov 14, 2021
@DL6ER DL6ER deleted the tweak/warning_messages branch November 14, 2021 12:00
@DL6ER DL6ER mentioned this pull request Dec 20, 2021
5 tasks
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-12-web-v5-9-and-core-v5-7-released/51795/1

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-12-web-v5-9-and-core-v5-7-released/51795/3

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/dnsmasq-warn-reducing-dns-packet-size/51803/2

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/issue-with-pihole-and-ipv6-error/51802/3

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/maximum-number-of-concurrent-dns-queries-reached/51804/8

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/dnsmasq-warn-duplicate-dhcp-option-23/51811/2

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/long-term-load-15min-avg-larger-than-number-of-processors/51826/2

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/warning-in-dnsmasq-core-using-interface-eth0-instead-pi-hole-running-on-virtual-interface-eth0-0/51847/2

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/adminlte-version-is-v5-9-php-socket-0-connection-refused/51839/11

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/warning-in-dnsmasq-core-ignoring-query-from-non-local-network/51879/2

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/maximum-number-of-concurrent-dns-queries-reached-max-150/51910/7

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/ignoring-domain-config-domain-for-dhcp-host-name-hostname/52027/4

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/warning-messages-from-dnsmasq/52034/3

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/issues-with-pihole-status-after-upgrading/52340/5

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/wifi-devices-are-reporting-no-internet-connection-and-cant-access-internet-after-latest-update/52405/3

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/dnsmasq-warn-with-vpn-after-update/52451/2

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/dns-warning-with-latest-update/52465/2

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/dns-masq-warning-help-needed/52954/2

@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/0-blocking-no-adlists-dns-query-limit-warning-after-update/59978/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants