diff mbox series

nscd: Fix netlink cache invalidation if epoll is used

Message ID 13076742.uLZWGnKmhe@linux-e202.suse.de
State New
Headers show
Series nscd: Fix netlink cache invalidation if epoll is used | expand

Commit Message

Fabian Vogt July 26, 2022, 2:06 p.m. UTC
Processes cache network interface information such as whether IPv4 or IPv6
are enabled. This is only checked again if the "netlink timestamp" provided
by nscd changed, which is triggered by netlink socket activity.

However, in the epoll handler for the netlink socket, it was missed to
assign the new timestamp to the nscd database. The handler for plain poll
did that properly, copy that over.

This bug caused that e.g. processes which started before network
configuration got unusuable addresses from getaddrinfo, like IPv6 only even
though only IPv4 is available:
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/1041

Signed-off-by: Fabian Vogt <fvogt@suse.de>
---
 nscd/connections.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Andreas Schwab July 27, 2022, 9:31 a.m. UTC | #1
Can you please create a bug on https://sourceware.org/bugzilla/?  See
https://sourceware.org/glibc/wiki/Contribution%20checklist for more
information.
diff mbox series

Patch

diff --git a/nscd/connections.c b/nscd/connections.c
index 61d1674eb4..531d2e83df 100644
--- a/nscd/connections.c
+++ b/nscd/connections.c
@@ -2284,7 +2284,8 @@  main_loop_epoll (int efd)
 					     sizeof (buf))) != -1)
 	      ;
 
-	    __bump_nl_timestamp ();
+	    dbs[hstdb].head->extra_data[NSCD_HST_IDX_CONF_TIMESTAMP]
+	      = __bump_nl_timestamp ();
 	  }
 # endif
 	else