From: Evgeny Vereshchagin Date: Thu, 17 Mar 2016 21:06:17 +0000 (+0000) Subject: nspawn: don't run nspawn --port=... without libiptc support X-Git-Tag: v230~253^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1c1ea217357c60ab2f57ea8f20d84166f641f49f;p=thirdparty%2Fsystemd.git nspawn: don't run nspawn --port=... without libiptc support We get $ systemd-nspawn --image /dev/loop1 --port 8080:80 -n -b 3 --port= is not supported, compiled without libiptc support. instead of a ping-nc-iptables debugging session --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index be07625a03c..eb89916b7e1 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -977,6 +977,13 @@ static int verify_arguments(void) { return -EINVAL; } +#ifndef HAVE_LIBIPTC + if (arg_expose_ports) { + log_error("--port= is not supported, compiled without libiptc support."); + return -EOPNOTSUPP; + } +#endif + if (arg_start_mode == START_BOOT && arg_kill_signal <= 0) arg_kill_signal = SIGRTMIN+3;