diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2021-09-01 15:58:17 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2021-09-09 15:40:04 +0200 |
commit | b15e97cb9d0008faccd4df80aa218523a548f2ff (patch) | |
tree | a5b24e42ab4b9a76471d3dc4e68eed4c040b3480 | |
parent | 647a41379402cf0fae495f1be5d15d0ca8ed1e16 (diff) | |
download | passt-b15e97cb9d0008faccd4df80aa218523a548f2ff.tar passt-b15e97cb9d0008faccd4df80aa218523a548f2ff.tar.gz passt-b15e97cb9d0008faccd4df80aa218523a548f2ff.tar.bz2 passt-b15e97cb9d0008faccd4df80aa218523a548f2ff.tar.lz passt-b15e97cb9d0008faccd4df80aa218523a548f2ff.tar.xz passt-b15e97cb9d0008faccd4df80aa218523a548f2ff.tar.zst passt-b15e97cb9d0008faccd4df80aa218523a548f2ff.zip |
conf: Introduce PASST_LEGACY_NO_OPTIONS ifdef for legacy
Before introducing options, the default behaviour in passt mode was
to forward all ports, to run in foreground and to log to stderr.
Make it a bit more convenient to restore that at build time.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r-- | conf.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -1144,6 +1144,18 @@ void conf(struct ctx *c, int argc, char **argv) if (!*c->pasta_ifn) strncpy(c->pasta_ifn, c->ifn, IFNAMSIZ); +#ifdef PASST_LEGACY_NO_OPTIONS + if (c->mode == MODE_PASST) { + c->foreground = 1; + c->stderr = 1; + + if (!tcp_tap) { + memset(c->tcp.port_to_tap, 0xff, + PORT_EPHEMERAL_MIN / 8); + } + } +#endif + if (c->mode == MODE_PASTA) { if (!tcp_tap || tcp_tap == PORT_AUTO) { ns_ports_arg.proto = IPPROTO_TCP; |