Reliably detecting the absence of IPv6

Jonas Lochmann openwrt at jonaslochmann.de
Thu Dec 11 22:07:18 PST 2025


Am Thu, Dec 11, 2025 at 01:11:41PM -0700, schrieb Philip Prindeville:
> > Happy Eyeballs - just try it and see if it works. It would expect bind
> > to do exactly that.
> 
> 
> Sorry, try which out?

The IPv6 connection.

> Happy Eyeballs (also called Fast Fallback) is an algorithm published
> by the IETF that makes dual-stack applications (those that understand
> both IPv4 and IPv6) more responsive to users by attempting to connect
> using both IPv4 and IPv6 at the same time (preferring IPv6), thus
> minimizing IPv6 brokenness and DNS whitelisting experienced by users
> that have imperfect IPv6 connections or setups. The name "happy
> eyeballs" derives from the term "eyeball" to describe endpoints which
> represent human Internet end-users, as opposed to servers. 

Source: https://en.wikipedia.org/wiki/Happy_Eyeballs

I've seen bad developers "testing" the internet connection before
sending a request instead of handling errors during the request, thus
causing crashes if the connection was interrupted between the check
and the actual request. The same way someone tested if an
authentication token expired before sending the actual request instead
of handling the authentication failure itself.

If you want to make a pre-check, then keep your check for the IPv6
default route. Just create an extra service that takes a look at the
output of "ip -6 monitor route" and refreshes the IPv6 status whenever
there is something with a default route. Take care of the race
conditions.



More information about the openwrt-devel mailing list