summaryrefslogtreecommitdiff
path: root/gio/gresolver.c
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2013-02-19 15:19:22 -0500
committerDan Winship <danw@gnome.org>2013-02-20 07:33:58 -0500
commitc6c11665668c47841011258e5dbca07ad3d8aba0 (patch)
tree0ed93619913d5bfe08a1345d8dee5474c0b1d907 /gio/gresolver.c
parentcfafad5aefeeab1a4ee208cefa15e01d31932611 (diff)
downloadglib-c6c11665668c47841011258e5dbca07ad3d8aba0.tar.gz
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
Diffstat (limited to 'gio/gresolver.c')
-rw-r--r--gio/gresolver.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gio/gresolver.c b/gio/gresolver.c
index 589e3242b..5549e4fd2 100644
--- a/gio/gresolver.c
+++ b/gio/gresolver.c
@@ -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:
*