diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c index 1631b80e9e7..753abbccb38 100644 --- a/bin/varnishd/mgt/mgt_main.c +++ b/bin/varnishd/mgt/mgt_main.c @@ -624,7 +624,6 @@ main(int argc, char * const *argv) const char *h_arg = "critbit"; const char *n_arg = getenv("VARNISH_DEFAULT_N"); const char *S_arg = NULL; - const char *s_arg = "default,100m"; const char *W_arg = NULL; const char *c; char *p; @@ -791,9 +790,6 @@ main(int argc, char * const *argv) /* Process delayed arguments */ VTAILQ_FOREACH(alp, &arglist, list) { switch(alp->arg[0]) { - case 'a': - MAC_Arg(alp->val); - break; case 'f': if (*alp->val != '\0') alp->priv = mgt_f_read(alp->val); @@ -824,9 +820,6 @@ main(int argc, char * const *argv) case 'r': MCF_ParamProtect(cli, alp->val); break; - case 's': - STV_Config(alp->val); - break; default: break; } @@ -908,9 +901,23 @@ main(int argc, char * const *argv) vext_copyin(vident); vext_load(); - /* If no -s argument specified, process default -s argument */ + /* defaults if arguments not present */ if (!arg_list_count("s")) - STV_Config(s_arg); + (void) arg_list_add('s', "default,100m"); + + VTAILQ_FOREACH(alp, &arglist, list) { + switch(alp->arg[0]) { + case 'a': + MAC_Arg(alp->val); + break; + case 's': + STV_Config(alp->val); + break; + default: + break; + } + cli_check(cli); + } /* Configure CLI and Transient storage, if user did not */ STV_Config_Final(); diff --git a/bin/varnishtest/tests/c00003.vtc b/bin/varnishtest/tests/c00003.vtc index 1ad25692225..08cbe9e629e 100644 --- a/bin/varnishtest/tests/c00003.vtc +++ b/bin/varnishtest/tests/c00003.vtc @@ -1,5 +1,7 @@ varnishtest "Check that we fail to start with erroneous -a/-b arguments" +setenv VARNISH_DEFAULT_N ${tmpdir} + # Duplicate -a arguments # XXX: this cannot be tested reliably, we tolerate port collision shell -err -match "have same address|already in use|Address in use" {