Commit f861ad21 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fail if multiple -a arguments return the same suckaddr.

Fixes	#1813
parent 00bcc3ea
......@@ -128,6 +128,13 @@ mac_callback(void *priv, const struct suckaddr *sa)
CAST_OBJ_NOTNULL(mh, priv, MAC_HELP_MAGIC);
VTAILQ_FOREACH(ls, &heritage.socks, list) {
if (!VSA_Compare(sa, ls->addr)) {
ARGV_ERR("-a arguments %s and %s have same address\n",
ls->name, mh->name);
return (-1);
}
}
ALLOC_OBJ(ls, LISTEN_SOCK_MAGIC);
AN(ls);
ls->sock = -1;
......
varnishtest "Duplicate -a arguments"
err_shell {have same address} "${varnishd} -d -a 127.0.0.1:38484 -a 127.0.0.1:38484 -b localhost:80 2>&1"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment