IPv[46] parsing

Poul-Henning Kamp phk at phk.freebsd.dk
Wed Oct 28 10:55:04 CET 2015


--------
In message <CAJ6ZYQwjqhjpcXEV9ef2-cX4B3MdcgCSKL15EZOkpZR=zbYP=Q at mail.gmail.com>
, 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.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list