The address parser was failing when using "0" as a shortcut for INADDR_ANY.
This patch intercepts the "0" prefix and normalizes it to "0.0.0.0"
before the address is parsed.
struct hld_url_cfg *purl;
struct hld_path *p = NULL;
struct hbuf opts_buf = HBUF_NULL;
- char quic_addr[128];
+ char quic_addr[128], tmp_addr[16];
if (strncmp(url, "http://", 7) == 0)
addr = url + 7;
}
}
+ if (addr[0] == '0' && addr[1] == ':') {
+ snprintf(tmp_addr, sizeof(tmp_addr), "0.0.0.0:%s", addr + 2);
+ addr = tmp_addr;
+ }
+
if (!is_quic) {
addr = strdup(addr);
}