diff options
| author | David Gibson <david@gibson.dropbear.id.au> | 2026-05-15 15:34:04 +1000 |
|---|---|---|
| committer | David Gibson <david@gibson.dropbear.id.au> | 2026-05-15 15:34:04 +1000 |
| commit | c41360d2bf6999301196b69b7802e30412d3d203 (patch) | |
| tree | 89e8802224a704b2f26c47e361f5076c76ab3d20 | |
| parent | bc6c909ef1fcd51b42492a523c417c7cab60d72b (diff) | |
| download | passt-bug205.tar passt-bug205.tar.gz passt-bug205.tar.bz2 passt-bug205.tar.lz passt-bug205.tar.xz passt-bug205.tar.zst passt-bug205.zip | |
fwd_rule: Allow parsing * as a forwarding addressbug205
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>
| -rw-r--r-- | fwd_rule.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 { |
