DHCP trigger causing problems on a semi-black-box CC build

I'm new to OpenWRT but not to Linux or networking. I have a consumer-grade router that's using OpenWRT without publishing anything (probably violating the GPL or whatever, but that's beside the point) so I don't know what their changes are. I'm actively using this router for internet so I am reluctant to attempt to build an OpenWRT package and deploy it, potentially overwriting any vendor-specific changes. I have a root account on it. I'm trying to play an MMO, but it's particularly sensitive to something that happens when my router renews its DHCP lease every hour, causing me to be kicked out to the login screen. I'd like to fix it. Router support seems dead.

The router is running Chaos Calmer r47046. Logs are at the bottom of the post. I suspect the problem is the dnsmasq exiting with SIGTERM (or maybe the igmpproxy select error, but I tried fixing that too). I've made changes via vim on the running system and then rebooted but I see the exact same log entries even though the changes persist. I'm not sure why my changes don't seem to have any effect.

I've tried modifying /etc/init.d/dnsmasq reload_service() from

rc_procd start_service "$@"
return 0

to

rc_procd_start_service "$@"
kill -HUP $(ps | grep '[s]bin/dnsmasq' | cut -d' ' -f1 )

( https://github.com/openwrt/openwrt/commit/93227e4d3fb81332f1dcb6eaa158ddf914ca67a6#diff-f65b4391dc02a776f873f8e933742458 )

I'd try procd_send_signal dnsmasq "$@" but it looks like chaos calmer doesn't have procd_send_signal judging from /lib/functions/procd.sh or whatever.

I've also changed service_triggers() from

procd_add_reload_trigger "dhcp"
procd_add_raw_trigger "interface.*" 2000 /etc/init.d/dnsmasq restart

to

procd_add_reload_trigger "dhcp"
procd_add_raw_trigger "interface.*" 2000 /etc/init.d/dnsmasq reload

I also manually applied the igmpproxy fix referred to in https://dev.archive.openwrt.org/ticket/20028.html and https://forum.archive.openwrt.org/viewtopic.php?id=53952 .

Since I haven't seen any difference in the logs or symptoms... Does modifying stuff in /etc/init.d/ on an actively running router not work? I've rebooted the router and it still doesn't seem to do anything different even though my changes persist. When I run /etc/init.d/dnsmasq reload it seems to do what I want. Or maybe something else dhcp-related is firing a dnsmasq restart and I can't find it?

logread provides the following before I get booted to the login screen. The logs are the same regardless of my changes and happens every hour at the same minute based on my last boot (i.e. half my DHCP lease time; this boot it's at xx:20)

Also is there a way I can force the renewal manually so I can check changes faster? :slight_smile:


Sun Feb 23 22:20:16 2020 daemon.notice netifd: wan (1885): Sending renew...
Sun Feb 23 22:20:16 2020 daemon.notice netifd: wan (1885): Lease of [my ip address] obtained, lease time 7200
Sun Feb 23 22:20:17 2020 user.notice root: do nothing
Sun Feb 23 22:20:17 2020 user.notice root: process holding firewall.lock not exist
Sun Feb 23 22:20:17 2020 kern.info kernel: [ 3623.040000] ar8327: Disable igmp snooping function.
Sun Feb 23 22:20:17 2020 daemon.notice netifd: wan (1885):
Sun Feb 23 22:20:17 2020 daemon.notice netifd: wan (1885): SSDK Init OK!
Sun Feb 23 22:20:17 2020 daemon.notice netifd: wan (1885): operate done.
Sun Feb 23 22:20:17 2020 daemon.notice netifd: wan (1885):
Sun Feb 23 22:20:17 2020 user.warn igmpproxy[2080]: select() failure; Errno(4): Interrupted system call
Sun Feb 23 22:20:17 2020 kern.info kernel: [ 3623.340000] ar8327: Enable igmp snooping function.
Sun Feb 23 22:20:17 2020 daemon.notice netifd: wan (1885):
Sun Feb 23 22:20:17 2020 daemon.notice netifd: wan (1885): SSDK Init OK!
Sun Feb 23 22:20:17 2020 daemon.notice netifd: wan (1885): operate done.
Sun Feb 23 22:20:17 2020 daemon.notice netifd: wan (1885):
Sun Feb 23 22:20:19 2020 daemon.info dnsmasq[4804]: exiting on receipt of SIGTERM
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq[10921]: started, version 2.78 cachesize 150
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq[10921]: DNS service limited to local subnets
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq[10921]: compile time options: IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth no-DNSSEC no-ID loop-detect inotify
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq-dhcp[10921]: DHCP, IP range 192.168.8.2 -- 192.168.8.201, lease time 7d
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq[10921]: using local addresses only for domain lan
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq[10921]: reading /tmp/resolv.conf.auto
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq[10921]: using local addresses only for domain lan
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq[10921]: using nameserver 1.1.1.1#53
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq[10921]: using nameserver 8.8.8.8#53
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq[10921]: read /tmp/hosts/dhcp.cfg02411c - 1 addresses
Sun Feb 23 22:20:23 2020 daemon.info dnsmasq-dhcp[10921]: read /etc/ethers - 0 addresses

it's probably just the Chinese cybercrime unit renewing their video stream of your bedroom...

seriously, it's time to get a device that's secure and trustworthy. either install latest official release, or if it's not supported consider some new hardware. chaos calmer is totally insecure at this point

Send me the money for a new 802.11ac router that isn't ugly looking (the wife requirement) and I'll gladly replace it. In the meantime I'm not sure if the newest official release will brick this particular device, since it's not on the list. Portal (Razer / Ignition Design Labs) - bringing up modern OpenWrt

I hear ya, but Chaos Calmer is very old and I'm pretty sure has actively automatically exploited vulnerabilities. I get hundreds to thousands of people port-scanning my router daily. There's a reasonable likelihood your router is already part of someone's botnet. Just sayin.

Alright, thanks, I'll keep that in mind for the future. Until I can change that, I'd like to make this part work.

Does the dhcp client get a renewal of the same IP address it used to have, or does it get a new IP address... There is no way to survive a new IP address, that will cause you to be kicked out of everything.

1 Like

Same IP address.

I traced through a lot of the scripts. Disabling QOS (/etc/init.d/qos stop), which I wasn't using anyway, stopped dnsmasq from restarting, which seemed to solve my problem.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.