fix the 'local' keyword in DNS server settings.

This commit is contained in:
Nikos Mavrogiannopoulos
2013-03-01 23:32:06 +01:00
parent 10d1215a1f
commit 4ca6484129
2 changed files with 13 additions and 5 deletions

2
NEWS
View File

@@ -5,6 +5,8 @@ Reported by Mike Miller.
- Use TCP wrappers (libwrap) when present.
- Fixed issue with the 'local' keyword in DNS server.
- Added configuration options 'user-profile' and 'always-require-cert' to
enable non-openconnect clients to connect.

View File

@@ -96,10 +96,16 @@ int ret, e;
if (family == AF_INET) {
if (strcmp(p, "0.0.0.0")==0)
p = NULL;
if (local != 0)
vinfo->ipv4_local = p;
else
vinfo->ipv4 = p;
} else {
if (strcmp(p, "::")==0)
p = NULL;
if (local != 0)
vinfo->ipv6_local = p;
else
vinfo->ipv6 = p;
}
@@ -150,13 +156,13 @@ struct ifreq ifr;
if (ret < 0)
oclog(ws, LOG_DEBUG, "cannot obtain IPv4 local IP for %s", vinfo->name);
if (vinfo->ipv4_dns && strcmp(vinfo->ipv4_dns, "local") == 0)
#define LOCAL "local"
if (ws->config->network.ipv4_dns && strcmp(ws->config->network.ipv4_dns, LOCAL) == 0)
vinfo->ipv4_dns = vinfo->ipv4_local;
else
vinfo->ipv4_dns = ws->config->network.ipv4_dns;
if (vinfo->ipv6_dns && strcmp(vinfo->ipv6_dns, "local") == 0)
if (ws->config->network.ipv6_dns && strcmp(ws->config->network.ipv6_dns, LOCAL) == 0)
vinfo->ipv6_dns = vinfo->ipv6_local;
else
vinfo->ipv6_dns = ws->config->network.ipv6_dns;