summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2014-06-16 00:50:17 +0200
committerSteven Barth <steven@midlink.org>2014-06-16 00:50:17 +0200
commit521ffa12eb85561b5ca3de2f807485bcb004cf42 (patch)
tree6cf5920b534657c1fe8dd6d442e489de2087f510 /src
parentff3f9bb1a2421c02f53504b177ff35e366ed43ab (diff)
config: accept domains with trailing .
Diffstat (limited to 'src')
-rw-r--r--src/config.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/config.c b/src/config.c
index db5ca3b..75e9239 100644
--- a/src/config.c
+++ b/src/config.c
@@ -447,7 +447,13 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr
continue;
uint8_t buf[256];
- int len = dn_comp(blobmsg_get_string(cur), buf, sizeof(buf), NULL, NULL);
+ char *domain = blobmsg_get_string(cur);
+ size_t domainlen = strlen(domain);
+ if (domainlen > 0 && domain[domainlen - 1] == '.')
+ domain[domainlen - 1] = 0;
+
+ int len = dn_comp(domain, buf, sizeof(buf), NULL, NULL);
+ free(domain);
if (len <= 0)
goto err;