Enumerate the GSocketConnectable before checking for a default route.
For some connectable types this will involve a DNS lookup. This will
elminate false positives for hosts behind a VPN since DNS lookup will
fail if the VPN is not connected.
https://bugzilla.gnome.org/show_bug.cgi?id=694181
GSocketAddressEnumerator *enumerator;
GSocketAddress *addr;
- if (priv->have_ipv4_default_route &&
- priv->have_ipv6_default_route)
- return TRUE;
-
if (priv->networks->len == 0)
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NETWORK_UNREACHABLE,
return FALSE;
}
+ if (priv->have_ipv4_default_route &&
+ priv->have_ipv6_default_route)
+ {
+ g_object_unref (enumerator);
+ g_object_unref (addr);
+ return TRUE;
+ }
+
while (addr)
{
if (G_IS_INET_SOCKET_ADDRESS (addr))