2015-10-28 9:58 GMT+01:00 Poul-Henning Kamp <[email protected]>: > -------- > In message > <CAJV_h0axHvroOtMPM83q=dcfhbtdl_xmzmglu0q8mwwncbs...@mail.gmail.com> > , Federico Schwindt writes: > >>While moving from 4.0.x to 4.1 I noticed that std.ip(..., "::1") doesn't >>work anymore. > > I agree this is very far from optimal, but adding special-casing > IPv6 address by IPv6 address is certainly *not* the way forward. > > The real question is, what does "::1:8080" mean ?
It's the IPv6 address 0:0:0:0:0:0:1:8080. I don't see how it could mean anything else. > Please propose the exact algorithm you prose for turning strings > into IP numbers, and bear in mind that we need to be able to > include port numbers. I'm not Federico, and this is not an exact algorithm, but: If string contains four dots and 0 or 1 :-s → parse as v4 (with or without port depending on presence of :) If string contains four dots and more than 1 and no []: → parse as v4 mapped ipv6 (port is empty) If string contains four dots and more than 1 and []: → parse as v4 mapped ipv6 with port If string contains :: and no [] → parse as v6 (port is empty) If string contains 7 :s and no [], parse as v6 (port is empty). If string contains :: and [] → parse as v6 with port If string contains 7 :s and [], parse as v6 with port Yes, this means you can't use 127.1 and similar as valid IPs. Don't do that, then. IMO, etc. -- Tollef Fog Heen | Engineer fastly.com | @fastly | Linkedin _______________________________________________ varnish-dev mailing list [email protected] https://www.varnish-cache.org/lists/mailman/listinfo/varnish-dev
