Re: ipcacheAddEntryFromHosts - problem with ip6 info in /etc/hosts

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Wed, 31 Oct 2001 19:00:16 +0100

Robert Collins wrote:
>
> On Wed, 2001-10-31 at 21:24, Henrik Nordstrom wrote:
> > Yes, but what about the ':' part of the question?
> >
> > I.e. is it safe to assume that IPv6 addresses always have one or more : in
> > them?
>
> RFC 2373 section 2.2 covers this, and the answer is yes.

fine.

if (safe_itoa(...)) {
   /* IPv4 */
} if (strstr(ip, ":") && !*strcspn(ip, ":.0123456789")) {
   /* IPv6, log to debug level 2 */
} else {
   /* unknown/error, log to debug level 1 */
}
Received on Wed Oct 31 2001 - 10:59:35 MST

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:14:36 MST