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
---
fwd_rule.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fwd_rule.c b/fwd_rule.c
index cb37a990..04a0101d 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 {
--
2.54.0