From 10caf656348c4a2166ab19c00d06f1693076442e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20L=C3=A9caille?= Date: Mon, 23 Nov 2020 11:36:57 +0100 Subject: [PATCH] MINOR: tools: Add support for QUIC addresses parsing. Add "quic4" and "quic6" keywords to str2sa_range() to parse QUIC IPv4 and IPv6 addresses respectively. --- src/tools.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/tools.c b/src/tools.c index fdc91909a..6e84fb217 100644 --- a/src/tools.c +++ b/src/tools.c @@ -950,6 +950,18 @@ struct sockaddr_storage *str2sa_range(const char *str, int *port, int *low, int ss.ss_family = AF_UNSPEC; sock_type = ctrl_type = SOCK_DGRAM; } + else if (strncmp(str2, "quic4@", 6) == 0) { + str2 += 6; + ss.ss_family = AF_INET; + sock_type = SOCK_DGRAM; + ctrl_type = SOCK_STREAM; + } + else if (strncmp(str2, "quic6@", 6) == 0) { + str2 += 6; + ss.ss_family = AF_INET6; + sock_type = SOCK_DGRAM; + ctrl_type = SOCK_STREAM; + } else if (strncmp(str2, "fd@", 3) == 0) { str2 += 3; ss.ss_family = AF_CUST_EXISTING_FD;