On Wed, Oct 28, 2015 at 10:55 AM, Poul-Henning Kamp <[email protected]> wrote:
> -------- > In message <CAJ6ZYQwjqhjpcXEV9ef2-cX4B3MdcgCSKL15EZOkpZR=zbYP= > [email protected]> > , Guillaume Quintard writes: > > >I'm in favor of mandatory brackets for IPv6, but would this do ? > >- first char is [: it's IPv6 > >- if you find a letter or colon: it's IPv6 > > Remember that it is not just numeric formats. > > In general this is about what we pass to the two fields of getaddrinfo(3), > we don't convert to IP#s ourselves. > > Ah, my bad, then there's the question of how much error types we want to raise (vss_parse catches some of them, but far from all), because it could be as simple as: - find first colon (fc) - find last colon (lc) fc == lc => ipv4 with port fc != lc *(lc - 1) == ']' => IPv6 with port (and check the first char is indeed '[') else IPv6 without port -- Guillaume Quintard
_______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
