diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-05-25 15:20:27 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2015-05-25 15:58:02 +0800 |
commit | a5a6da46a0b22d5c7695774c6c7eb26856bc6488 (patch) | |
tree | 1d87411b72b90c5a95e637e2c2cfb99cc44727ad /openbsc/src/gprs/sgsn_ares.c | |
parent | 39c430ee2929f0671203974db11dfdd4ff4841cb (diff) |
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.
Diffstat (limited to 'openbsc/src/gprs/sgsn_ares.c')
-rw-r--r-- | openbsc/src/gprs/sgsn_ares.c | 8 |
1 files changed, 7 insertions, 1 deletions
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; } |