Merge pull request #554 from ncopa/improve-error-message

miniupnpd: improve error message for bad config
This commit is contained in:
Thomas BERNARD 2021-08-06 19:09:47 +02:00 committed by GitHub
commit 1dae9bfca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -1817,6 +1817,10 @@ init(int argc, char * * argv, struct runtime_vars * v)
} }
if(!ext_if_name || !lan_addrs.lh_first) { if(!ext_if_name || !lan_addrs.lh_first) {
/* bad configuration */ /* bad configuration */
if(!ext_if_name)
INIT_PRINT_ERR(stderr, "Error: Option -i missing and ext_ifname is not set in config file\n");
if (!lan_addrs.lh_first)
INIT_PRINT_ERR(stderr, "Error: Option -a missing and listening_ip is not set in config file\n");
goto print_usage; goto print_usage;
} }