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:
袁建鹏
2022-04-18 15:25:54 +01:00
committed by Simon Kelley
parent 03345ecefe
commit 1a98d1a94f
2 changed files with 3 additions and 1 deletions

View File

@@ -665,6 +665,7 @@ struct resolvc {
struct resolvc *next;
int is_default, logged;
time_t mtime;
ino_t ino;
char *name;
#ifdef HAVE_INOTIFY
int wd; /* inotify watch descriptor */