continue;
}
}
- if (resolv_link_resolution(srv, OBJ_TYPE_SERVER, 0) == -1) {
+ if (!srv->srvrq && resolv_link_resolution(srv, OBJ_TYPE_SERVER, 0) == -1) {
ha_alert("config : %s '%s', unable to set DNS resolution for server '%s'.\n",
proxy_type_str(px), px->id, srv->id);
err_code |= (ERR_ALERT|ERR_ABORT);
int snr_update_srv_status(struct server *s, int has_no_ip)
{
struct resolvers *resolvers = s->resolvers;
- struct resolv_resolution *resolution = s->resolv_requester->resolution;
+ struct resolv_resolution *resolution = (s->resolv_requester ? s->resolv_requester->resolution : NULL);
int exp;
/* If resolution is NULL we're dealing with SRV records Additional records */
return 1;
}
- resolution = s->resolv_requester->resolution;
+ resolution = (s->resolv_requester ? s->resolv_requester->resolution : NULL);
if (!resolution)
return 1;
if (!resolv_locked)
HA_SPIN_LOCK(DNS_LOCK, &srv->resolvers->lock);
- /* run time DNS resolution was not active for this server
+ /* run time DNS/SRV resolution was not active for this server
* and we can't enable it at run time for now.
*/
- if (!srv->resolv_requester)
+ if (!srv->resolv_requester && !srv->srvrq)
goto err;
chunk_reset(&trash);
if (hostname_dn_len == -1)
goto err;
- resolution = srv->resolv_requester->resolution;
+ resolution = (srv->resolv_requester ? srv->resolv_requester->resolution : NULL);
if (resolution &&
resolution->hostname_dn &&
strcmp(resolution->hostname_dn, hostname_dn) == 0)