Revision: 14780 Author: adrian.chadd Date: Sat Sep 4 05:35:28 2010 Log: Merge r13332 from /playpen/ipv6_acl
Shuffle around the decode_v6_addr function order; first try and parse the IPv6 address and, if that fails, try to parse out a masklen. getnameinfo() - when not told what address family to parse - was happily parsing an integer as an IPv4 address. This isn't what I want. Luckily a lone integer isn't a valid IPv6 address? :) http://code.google.com/p/lusca-cache/source/detail?r=14780 Modified: /playpen/LUSCA_HEAD_ipv6 /playpen/LUSCA_HEAD_ipv6/src/acl.c ======================================= --- /playpen/LUSCA_HEAD_ipv6/src/acl.c Sat Sep 4 05:33:15 2010 +++ /playpen/LUSCA_HEAD_ipv6/src/acl.c Sat Sep 4 05:35:28 2010 @@ -501,14 +501,17 @@ { int a, r; + /* Try to parse an IPv6 address */ + r = sqinet_aton(A, asc, SQATON_FAMILY_IPv6); + if (r) + return 1; + /* Is it a CIDR netmask? Store it away */ r = sscanf(asc, "%d", &a); if (r > 0) { return sqinet_set_mask_addr(A, a); } - - /* Try to parse an IPv6 address */ - return sqinet_aton(A, asc, SQATON_NONE); + return 0; } /* Stolen shamelessly from Squid-3; thanks Amos! */ -- You received this message because you are subscribed to the Google Groups "lusca-commit" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/lusca-commit?hl=en.
