Fix parsing of synth-domain=domain,addr,addr,prefix

This commit is contained in:
Simon Kelley
2013-10-25 10:37:30 +01:00
parent 1f776a4aa2
commit eec5c1e21c

View File

@@ -1862,7 +1862,10 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
}
else
{
char *prefstr;
arg = split(comma);
prefstr = split(arg);
if (inet_pton(AF_INET, comma, &new->start))
{
new->is6 = 0;
@@ -1883,6 +1886,13 @@ static int one_opt(int option, char *arg, char *errstr, char *gen_err, int comma
#endif
else
ret_err(gen_err);
if (option != 's' && prefstr)
{
if (!(new->prefix = canonicalise_opt(prefstr)) ||
strlen(new->prefix) > MAXLABEL - INET_ADDRSTRLEN)
ret_err(_("bad prefix"));
}
}
new->domain = d;