> It seems a recent update to lib/libc/net/inet_addr.c is the culprit here.
> Any IP address with a component of 34 will fail in inet_aton().  Here's a 
> patch that should fix it up:
> 
> 
> Index: inet_addr.c
> ===================================================================
> RCS file: /home/ncvs/src/lib/libc/net/inet_addr.c,v
> retrieving revision 1.9
> diff -u -r1.9 inet_addr.c
> --- inet_addr.c       1999/10/31 04:43:55     1.9
> +++ inet_addr.c       1999/11/03 02:01:52
> @@ -65,6 +65,8 @@
>  
>  #include <ctype.h>
>  #include <errno.h>
> +#include <limits.h>
> +#include <stdlib.h>
>  #include <string.h>
>  
>  /*
> @@ -98,7 +100,7 @@
>       u_long val;
>       char *c;
>       char *endptr;
> -     int base, gotend, n;
> +     int gotend, n;
>  
>       c = (char *)cp;
>       n = 0;
> @@ -111,8 +113,10 @@
>               errno = 0;
>               val = strtoul(c, &endptr, 0);
>  
> -             if (val == ERANGE)      /* Fail completely if it overflowed. */
> +             if ((val == ULONG_MAX) && (errno == ERANGE)) {
> +                     /* Fail completely if it overflowed. */
>                       return (0);
> +             }
>               
>               /* 
>                * If the whole string is invalid, endptr will equal
> 

The check should be simply `if (errno == ERANGE)'.  The (val == ULONG_MAX)
check is a harmless bug (harmless because non-overflowing values > 0xffffff,
including ULONG_MAX, cause a failure later).

Bruce



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to