From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Fri, 20 Oct 2006 10:38:42 -0400 From: "Russ Cox" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu> Subject: Re: [9fans] Re: ip(2) man page: return code of parseip() and parsemaskip() In-Reply-To: <3281345f7d653afc3e8f3317d7a0bfed@coraid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <3281345f7d653afc3e8f3317d7a0bfed@coraid.com> Topicbox-Message-UUID: ceb2d1fa-ead1-11e9-9d60-3106f5b1d025 > but i think it's silly to differentiate between 192.168.0.1 and > ::ffff:192.168.0.1 an ip6 address. that's like a c compiler declaring > 0x3 != 3. No, it's not. It's like if atoi, in addition to returning the actual value, also returned the base the number was written in. Most callers wouldn't care, but some might. Most people calling parseip shouldn't care what format the address was in, and should use *to as the address. The only interesting question that should ever be asked of the return value is whether or not it is equal to 6. In particular, code that uses ip = parseip(to, from); and then goes on to use ip as an IP address is wrong and needs to be rewritten, not catered to. Russ