aboutgitcodebugslistschat
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2026-05-15 18:24:34 +1000
committerStefano Brivio <sbrivio@redhat.com>2026-05-16 17:05:56 +0200
commit296d7e32ec93f7534fcbf94b922a19eaea6e217c (patch)
tree1a104e28a6b37171fb8e9b9302f6bd1ad17f5725
parent666ef9e20c5c0ef2a5a61a7a7b68b9e2421e14e9 (diff)
downloadpasst-296d7e32ec93f7534fcbf94b922a19eaea6e217c.tar
passt-296d7e32ec93f7534fcbf94b922a19eaea6e217c.tar.gz
passt-296d7e32ec93f7534fcbf94b922a19eaea6e217c.tar.bz2
passt-296d7e32ec93f7534fcbf94b922a19eaea6e217c.tar.lz
passt-296d7e32ec93f7534fcbf94b922a19eaea6e217c.tar.xz
passt-296d7e32ec93f7534fcbf94b922a19eaea6e217c.tar.zst
passt-296d7e32ec93f7534fcbf94b922a19eaea6e217c.zip
fwd_rule: Allow parsing * as a forwarding addressHEADmaster
In our output in various places, we use "*", or sometimes "[*]" to indicate a dual stack unspecified address: that is a case where we listen on both 0.0.0.0 and ::. However we don't currently allow the same syntax when specifying forwarding rules on the command line. A * address can be indirectly specified by omitting the address entirely, but for consistency allow an explicit "*" or "[*]" as well. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rw-r--r--fwd_rule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fwd_rule.c b/fwd_rule.c
index cb37a99..04a0101 100644
--- a/fwd_rule.c
+++ b/fwd_rule.c
@@ -709,7 +709,9 @@ void fwd_rule_parse(char optname, bool del, const char *optarg,
p++;
}
- if (!inany_pton(p, &addr_buf))
+ if (strcmp(p, "*") == 0)
+ addr = NULL;
+ else if (!inany_pton(p, &addr_buf))
die("Bad forwarding address '%s'", p);
}
} else {