bring in IPv6 numeric address parsing fix from bind821.
XXX bind821 should be imported here
This commit is contained in:
parent
58cde1da1e
commit
46c3891136
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: inet_pton.c,v 1.9 1998/11/13 15:46:54 christos Exp $ */
|
||||
/* $NetBSD: inet_pton.c,v 1.10 1999/08/17 17:50:27 itojun Exp $ */
|
||||
|
||||
/* Copyright (c) 1996 by Internet Software Consortium.
|
||||
*
|
||||
|
@ -21,7 +21,7 @@
|
|||
#if 0
|
||||
static char rcsid[] = "Id: inet_pton.c,v 8.7 1996/08/05 08:31:35 vixie Exp ";
|
||||
#else
|
||||
__RCSID("$NetBSD: inet_pton.c,v 1.9 1998/11/13 15:46:54 christos Exp $");
|
||||
__RCSID("$NetBSD: inet_pton.c,v 1.10 1999/08/17 17:50:27 itojun Exp $");
|
||||
#endif
|
||||
#endif /* LIBC_SCCS and not lint */
|
||||
|
||||
|
@ -240,7 +240,8 @@ inet_pton6(src, dst)
|
|||
return (0);
|
||||
colonp = tp;
|
||||
continue;
|
||||
}
|
||||
} else if (*src == '\0')
|
||||
return (0);
|
||||
if (tp + INT16SZ > endp)
|
||||
return (0);
|
||||
*tp++ = (u_char) (val >> 8) & 0xff;
|
||||
|
@ -271,6 +272,8 @@ inet_pton6(src, dst)
|
|||
const int n = tp - colonp;
|
||||
int i;
|
||||
|
||||
if (tp == endp)
|
||||
return (0);
|
||||
for (i = 1; i <= n; i++) {
|
||||
endp[- i] = colonp[n - i];
|
||||
colonp[n - i] = 0;
|
||||
|
|
Loading…
Reference in New Issue