aboutsummaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-08-25 12:19:00 +0000
committerOmar Polo <op@omarpolo.com>2023-08-25 12:19:00 +0000
commitc2c051f28e8934a679f5ebe8195497ce5eccc56c (patch)
tree37337f94231132f5ce01273986bbac6de7215732 /parse.y
parent3cb7e8d7ace5f0ba13193181d5f8d63aa1923e0b (diff)
fix automatic guessing of `listen on'
default_host needs to be NULL for getaddrinfo(3) to listen on everything.
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y9
1 files changed, 5 insertions, 4 deletions
diff --git a/parse.y b/parse.y
index fcb0219..18c3ef6 100644
--- a/parse.y
+++ b/parse.y
@@ -38,7 +38,7 @@
struct conf *conf;
-static const char *default_host = "*";
+static const char *default_host = NULL;
static uint16_t default_port = 1965;
TAILQ_HEAD(files, file) files = TAILQ_HEAD_INITIALIZER(files);
@@ -229,7 +229,7 @@ option : CHROOT string {
yywarn("option `ipv6' is deprecated,"
" please use `listen on'");
if ($2)
- default_host = "*";
+ default_host = NULL;
else
default_host = "0.0.0.0";
}
@@ -354,7 +354,8 @@ vhost : SERVER string {
fatal("snprintf");
yywarn("missing `listen on' in server %s,"
- " assuming %s port %d", $2, default_host,
+ " assuming %s port %d", $2,
+ default_host ? default_host : "*",
default_port);
listen_on(default_host, portno);
}
@@ -1072,7 +1073,7 @@ parse_conf(struct conf *c, const char *filename)
{
struct sym *sym, *next;
- default_host = "*";
+ default_host = NULL;
default_port = 1965;
conf = c;