mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-29 20:34:11 +02:00
GNetworkAddress: drop cached addresses on resolver reload
If the resolver reloads (ie, if /etc/resolv.conf changes), GNetworkAddress needs to re-resolve its addresses the next time it's enumerated. Otherwise hosts that have different IP addresses inside and outside a VPN won't work correctly if you hold on to a GNetworkAddress for them for a long time. https://bugzilla.gnome.org/show_bug.cgi?id=694181
This commit is contained in:
@@ -846,6 +846,20 @@ g_resolver_lookup_records_finish (GResolver *resolver,
|
||||
lookup_records_finish (resolver, result, error);
|
||||
}
|
||||
|
||||
guint64
|
||||
g_resolver_get_serial (GResolver *resolver)
|
||||
{
|
||||
g_return_val_if_fail (G_IS_RESOLVER (resolver), 0);
|
||||
|
||||
g_resolver_maybe_reload (resolver);
|
||||
|
||||
#ifdef G_OS_UNIX
|
||||
return (guint64) resolver->priv->resolv_conf_timestamp;
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* g_resolver_error_quark:
|
||||
*
|
||||
|
Reference in New Issue
Block a user