]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: sock-inet: re-check IPv6 connectivity every 30s
authorWilly Tarreau <w@1wt.eu>
Fri, 9 May 2025 13:23:10 +0000 (15:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 May 2025 13:45:44 +0000 (15:45 +0200)
commit8a96216847757b053a435818b2e64b69703bad84
treead684548b0f4b32051a9f31b2bae855d6c559e13
parent1404f6fb7b6d00779deada7116ddd9b2ab060877
MEDIUM: sock-inet: re-check IPv6 connectivity every 30s

IPv6 connectivity might start off (e.g. network not fully up when
haproxy starts), so for features like resolvers, it would be nice to
periodically recheck.

With this change, instead of having the resolvers code rely on a variable
indicating connectivity, it will now call a function that will check for
how long a connectivity check hasn't been run, and will perform a new one
if needed. The age was set to 30s which seems reasonable considering that
the DNS will cache results anyway. There's no saving in spacing it more
since the syscall is very check (just a connect() without any packet being
emitted).

The variables remain exported so that we could present them in show info
or anywhere else.

This way, "dns-accept-family auto" will now stay up to date. Warning
though, it does perform some caching so even with a refreshed IPv6
connectivity, an older record may be returned anyway.
doc/configuration.txt
include/haproxy/defaults.h
include/haproxy/sock_inet.h
src/resolvers.c
src/sock_inet.c