Le 2015-10-10 15:49, Willy Tarreau a écrit :
Hi,
@@ -856,11 +883,28 @@ struct sockaddr_storage *str2sa_range(const char
*str, int *low, int *high, char
else { /* IPv4 and IPv6 */
int use_fqdn = 0;
- port1 = strrchr(str2, ':');
- if (port1)
- *port1++ = '\0';
- else
+ /* IPv6 wildcard */
+ if (!strcmp(str2, "::")) {
+ port1 = "";
+ }
You're changing the parser here, because it now accepts "::" in a place
where a port was expected.
May I ask : isn’t the parser just a parser ? Making the caller’s
responsibility to use or not the ports returned either in the
sockaddr_storage or the 2 int depending on the context ? (‘bind’
requires a port but ‘server’’s port is optional)
Is str2sa_range aware of the context it’s called ?
Regards,
Mildis