Commit 30762630 authored by Ghislain MARY's avatar Ghislain MARY

Define default DNS lookup order.

parent ecfff5f6
...@@ -72,6 +72,14 @@ static struct dns_resolv_conf *resconf(belle_sip_resolver_context_t *ctx) { ...@@ -72,6 +72,14 @@ static struct dns_resolv_conf *resconf(belle_sip_resolver_context_t *ctx) {
} }
#endif #endif
/* If the lookup order has not been initialized, initialize it now to the following order:
1. file
2. cache
3. bind
*/
if (ctx->resconf->lookup[0] == '\0') {
strncpy(ctx->resconf->lookup, "fcb", sizeof ctx->resconf->lookup);
}
return ctx->resconf; return ctx->resconf;
} }
......
...@@ -4388,7 +4388,6 @@ int dns_resconf_loadfromresolv(struct dns_resolv_conf *resconf) { ...@@ -4388,7 +4388,6 @@ int dns_resconf_loadfromresolv(struct dns_resolv_conf *resconf) {
memcpy(&resconf->nameserver[i],&addresses[i],sizeof(union res_sockaddr_union)); memcpy(&resconf->nameserver[i],&addresses[i],sizeof(union res_sockaddr_union));
} }
res_ndestroy(&res); res_ndestroy(&res);
strncpy(resconf->lookup, "fcb", sizeof resconf->lookup);
return i>0?0:-1; return i>0?0:-1;
} }
#endif /*HAVE_RESINIT*/ #endif /*HAVE_RESINIT*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment