- if (!addr_enum->addr->priv->sockaddrs)
- g_network_address_parse_sockaddr (addr_enum->addr);
- if (!addr_enum->addr->priv->sockaddrs)
+ GNetworkAddress *addr = addr_enum->addr;
+ GResolver *resolver = g_resolver_get_default ();
+ gint64 serial = g_resolver_get_serial (resolver);
+
+ if (addr->priv->resolver_serial != 0 &&
+ addr->priv->resolver_serial != serial)
+ {
+ /* Resolver has reloaded, discard cached addresses */
+ g_list_free_full (addr->priv->sockaddrs, g_object_unref);
+ addr->priv->sockaddrs = NULL;
+ }
+
+ if (!addr->priv->sockaddrs)
+ g_network_address_parse_sockaddr (addr);
+ if (!addr->priv->sockaddrs)