From a5a6da46a0b22d5c7695774c6c7eb26856bc6488 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 25 May 2015 15:20:27 +0800 Subject: sgsn: Allow to specify the DNS servers that should be used If no server is specified the default list will be used. This allows to separate the servers for the local network and GRX from each other. --- openbsc/src/gprs/sgsn_ares.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'openbsc/src/gprs/sgsn_ares.c') diff --git a/openbsc/src/gprs/sgsn_ares.c b/openbsc/src/gprs/sgsn_ares.c index 825b01c5b..c4012a4e3 100644 --- a/openbsc/src/gprs/sgsn_ares.c +++ b/openbsc/src/gprs/sgsn_ares.c @@ -157,10 +157,16 @@ int sgsn_ares_init(struct sgsn_instance *sgsn) optmask = ARES_OPT_FLAGS | ARES_OPT_SOCK_STATE_CB; - /*| ARES_OPT_SERVERS ... TODO..*/ + if (sgsn->ares_servers) + optmask |= ARES_OPT_SERVERS; ares_library_init(ARES_LIB_INIT_ALL); rc = ares_init_options(&sgsn->ares_channel, &options, optmask); + if (rc != ARES_SUCCESS) + return rc; + + if (sgsn->ares_servers) + rc = ares_set_servers(sgsn->ares_channel, sgsn->ares_servers); return rc; } -- cgit v1.2.3