From 1aa46b5a2c71578d63f836c446686c3bc7316733 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 15 Jul 2021 12:23:26 +0200 Subject: [PATCH] miniupnpd: improve error message for bad config Improve error message so users don't need read the source to figure out why miniupnpd refuses to start even if the usage is correct. --- miniupnpd/miniupnpd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miniupnpd/miniupnpd.c b/miniupnpd/miniupnpd.c index e4feac2..7ecb1a6 100644 --- a/miniupnpd/miniupnpd.c +++ b/miniupnpd/miniupnpd.c @@ -1817,6 +1817,10 @@ init(int argc, char * * argv, struct runtime_vars * v) } if(!ext_if_name || !lan_addrs.lh_first) { /* 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; }