diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-02-17 01:41:28 +0100 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-02-21 13:41:13 +0100 |
commit | ce4e7b4d5ddb213f45164015ef5479943fec2f8e (patch) | |
tree | f7256189813c4c699de12c72b3ac680bcf3cdc97 /conf.c | |
parent | fb70301b1358a7a65e0f6089ee9349330db2465a (diff) | |
download | passt-ce4e7b4d5ddb213f45164015ef5479943fec2f8e.tar passt-ce4e7b4d5ddb213f45164015ef5479943fec2f8e.tar.gz passt-ce4e7b4d5ddb213f45164015ef5479943fec2f8e.tar.bz2 passt-ce4e7b4d5ddb213f45164015ef5479943fec2f8e.tar.lz passt-ce4e7b4d5ddb213f45164015ef5479943fec2f8e.tar.xz passt-ce4e7b4d5ddb213f45164015ef5479943fec2f8e.tar.zst passt-ce4e7b4d5ddb213f45164015ef5479943fec2f8e.zip |
Makefile, conf, passt: Drop passt4netns references, explicit argc check
Nobody currently calls this as passt4netns, that was the name I used
before 'pasta', drop any reference before it's too late.
While at it, explicitly check that argc is bigger than or equal to
one, just as a defensive measure: argv[0] being NULL is not an issue
anyway.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'conf.c')
-rw-r--r-- | conf.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -532,7 +532,7 @@ static void conf_ip(struct ctx *c) */ static void usage(const char *name) { - if (strstr(name, "pasta") || strstr(name, "passt4netns")) { + if (strstr(name, "pasta")) { info("Usage: %s [OPTION]... [PID|PATH|NAME]", name); info(""); info("Without PID|PATH|NAME, run the default shell in a new"); @@ -550,7 +550,7 @@ static void usage(const char *name) info( " default: log to system logger only if started from a TTY"); info( " -h, --help Display this help message and exit"); - if (strstr(name, "pasta") || strstr(name, "passt4netns")) { + if (strstr(name, "pasta")) { info( " -I, --ns-ifname NAME namespace interface name"); info( " default: same interface name as external one"); } else { @@ -562,7 +562,7 @@ static void usage(const char *name) info( " -p, --pcap [FILE] Log tap-facing traffic to pcap file"); info( " if FILE is not given, log to:"); - if (strstr(name, "pasta") || strstr(name, "passt4netns")) + if (strstr(name, "pasta")) info(" /tmp/pasta_ISO8601-TIMESTAMP_PID.pcap"); else info(" /tmp/passt_ISO8601-TIMESTAMP_PID.pcap"); @@ -586,14 +586,14 @@ static void usage(const char *name) info( " -D, --dns ADDR Pass IPv4 or IPv6 address as DNS"); info( " can be specified multiple times"); info( " a single, empty option disables DNS information"); - if (strstr(name, "pasta") || strstr(name, "passt4netns")) + if (strstr(name, "pasta")) info( " default: don't send any addresses"); else info( " default: use addresses from /etc/resolv.conf"); info( " -S, --search LIST Space-separated list, search domains"); info( " a single, empty option disables the DNS search list"); - if (strstr(name, "pasta") || strstr(name, "passt4netns")) + if (strstr(name, "pasta")) info( " default: don't send any search list"); else info( " default: use search list from /etc/resolv.conf"); @@ -609,7 +609,7 @@ static void usage(const char *name) info( " -4, --ipv4-only Enable IPv4 operation only"); info( " -6, --ipv6-only Enable IPv6 operation only"); - if (strstr(name, "pasta") || strstr(name, "passt4netns")) + if (strstr(name, "pasta")) goto pasta_opts; info( " -t, --tcp-ports SPEC TCP port forwarding to guest"); |