On ons, 2008-08-13 at 22:40 +1200, Amos Jeffries wrote: > Henrik Nordstrom wrote: > > On ons, 2008-08-13 at 16:25 +1200, Amos Jeffries wrote: > >>> Or maybe = "" should be equivalent to SetEmpty() in which case the > >>> original code works, and can be simplified a lot... not sure how > >>> IPAddress is supposed to work here, if it at all is supposed to be used > >>> in = "".. > >> It should be capable of accepting it. "" == NULL == "garbage" to IPAddress. > > > > Assigning "garbage" is an error. > > > > What should the IPAddress be set to in such case? > > Should be no-addr aka empty in all parsing failed cases. The only valid > non-IP case is a resolvable FQDN, which becomes the first located IP.
Hmm.. looking again at the code and the logics is quite messed up
regarding addr2.
Should be
/* Decode addr2 */
if (!*addr2)
r->addr2.SetAnyAddr();
else if (!(q->addr2=addr2) ) {
debugs(28, 0, "aclIpParseIpData: unknown second address in '" <<
t << "'");
addr1 is also a bit busted.. should check that the address parsed fine
and barf otherwise.
fixing up both into something that makes sense.
And I also found the trigger making this show up on Windows.. The
substitute xgetaddrinfo() function does not return error on blank or
invalid addresses, instead the address -1 (~0) is returned..
Regards
Henrik
signature.asc
Description: This is a digitally signed message part
