[OpenWrt-Devel] dnsmasq stops receiving packets after network restart

Kristian Evensen kristian.evensen at gmail.com
Thu Sep 27 16:25:17 EDT 2018


On Tue, Sep 25, 2018 at 11:23 AM Jo-Philipp Wich <jo at mein.io> wrote:
> Maybe netlink congestion or something related to privilege dropping? Can
> you manage to capture an strace log of the running dnsmasq instance
> while the network is getting restarted?

After some discussion on the dnsmasq mailing list, the cause has been
found and your theory about "resubscribe" is correct. When dnsmasq is
configured to listened to one particular interface, dnsmasq binds
(SO_BINDTODEVICE) to this interface during startup if the interface is
available. On my devices, I had configured dnsmasq to only listen to
br-lan. When I restart networking, br-lan is re-created. This event is
not detected by dnsmasq and the socket will silently fail. If I
configure dnsmasq to listen to two interfaces, SO_BINDTODEVICE is
never used and the error disappears.

Why this error has appeared now is still unknown, but it could be
because no one has gone looking for it. My current work-around, base
on the advice of Simon Kelley, is to have the function which looks up
the interface to bind to (whichdevice()) return NULL. Filtering of
received packets is anyway done not dependent on the bound socket.


openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list