[Dnsmasq-discuss] Non-monotonic serial number in log-queries=extra

Dominik DL6ER dl6er at dl6er.de
Thu Jun 14 17:22:06 BST 2018


Dear Simon,

I use "--log-queries=extra". I noticed that when sending queries over
TCP, that the serial number (daemon->log_id) of the queries jump by 100,
e.g.

Jun 14 17:38:40 dnsmasq[30831]: 4 10.8.0.2/36989 query[A] google.de from
10.8.0.2
Jun 14 17:38:40 dnsmasq[30831]: 4 10.8.0.2/36989 forwarded google.de to
127.0.0.1
Jun 14 17:38:40 dnsmasq[30831]: 4 10.8.0.2/36989 reply google.de is
172.217.22.99
Jun 14 17:38:43 dnsmasq[30637]: 104 10.8.0.2/42334 query[A] google.de
from 10.8.0.2
Jun 14 17:38:43 dnsmasq[30637]: 104 10.8.0.2/42334 forwarded google.de
to 127.0.0.1
Jun 14 17:38:43 dnsmasq[30637]: 104 10.8.0.2/42334 reply google.de is
172.217.22.99

The first query was sent over TCP, the second over UDP.

This is caused by this part in the code run after forking TCP workers:

/* The child can use up to TCP_MAX_QUERIES ids, so skip that many. */
daemon->log_id += TCP_MAX_QUERIES;

Would it be possible to have the TCP workers use the same counter?
I'm thinking about sharing the log_id integer using shmget().

Best regards
Dominik




More information about the Dnsmasq-discuss mailing list