mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 10:18:25 +00:00
Add inode compare while checking resolv file change
Fix a bug found on OpenWrt when IPv4/6 dual stack enabled: The resolv file is located on tmpfs whose mtime resolution is 1 second. If the resolv file is updated twice within one second dnsmasq may can't notice the second update. netifd updates the resolv file with method: write temp then move, so adding an inode check fixes this bug.
This commit is contained in:
@@ -1665,9 +1665,10 @@ static void poll_resolv(int force, int do_reload, time_t now)
|
||||
else
|
||||
{
|
||||
res->logged = 0;
|
||||
if (force || (statbuf.st_mtime != res->mtime))
|
||||
if (force || (statbuf.st_mtime != res->mtime || statbuf.st_ino != res->ino))
|
||||
{
|
||||
res->mtime = statbuf.st_mtime;
|
||||
res->ino = statbuf.st_ino;
|
||||
if (difftime(statbuf.st_mtime, last_change) > 0.0)
|
||||
{
|
||||
last_change = statbuf.st_mtime;
|
||||
|
||||
Reference in New Issue
Block a user