From 1a0d076dfb4ecdf19eb7c31f28dc92d74f423156 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 21 May 2022 10:23:01 +0100 Subject: [PATCH] Disallow -4 and -6 in TOOLTYPE_NONNETWORK. They were accepted by Unix pterm, by mistake, and then totally ignored because nothing in pterm ever makes a network connection, so nothing cares whether you configured it to use IPv4 or IPv6. --- cmdline.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmdline.c b/cmdline.c index 8e48b358..68eafc8e 100644 --- a/cmdline.c +++ b/cmdline.c @@ -749,11 +749,13 @@ int cmdline_process_param(const char *p, char *value, if (!strcmp(p, "-4") || !strcmp(p, "-ipv4")) { RETURN(1); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); SAVEABLE(1); conf_set_int(conf, CONF_addressfamily, ADDRTYPE_IPV4); } if (!strcmp(p, "-6") || !strcmp(p, "-ipv6")) { RETURN(1); + UNAVAILABLE_IN(TOOLTYPE_NONNETWORK); SAVEABLE(1); conf_set_int(conf, CONF_addressfamily, ADDRTYPE_IPV6); }