Re: PHP 4.0 Bug #8884 Updated: gethostbyaddr returns a 15 chars string IP when an error occurs
| From: | milani at mclink dot it | Date: | Thu, 25 Jan 2001 00:49:21 +0000 |
| Subject: | Re: PHP 4.0 Bug #8884 Updated: gethostbyaddr returns a 15 chars string IP when an error occurs | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-44942@lists.php.net to get a copy of this message | ||
Hi! Nice to hear from you :-) I already tried to post the following line as a
possible solution to a possible problem under certain (unknown to me)
circumstances on the online manual page for GETHOSTBYADDR (but my note 10755
was rejected):
$TheName=trim(gethostbyaddr($row->THEHOST." "));
The original line:
$TheName=trim(gethostbyaddr($row->THEHOST));
called using an unresolvable IP like xx.xx.x.xxx returned something like
xx.xx.x.xxxMKJA, where MKJA represents some garbage I discovered was used to
fill up to 15 chars (the maximum length for an IP).
I guess an IP like 212.59.60.57 should do the job :-)
> ID: 8884
> Updated by: sniper
> Reported By: almico@almico.com
> Old-Status: Open
> Status: Feedback
> Bug Type: Network related
> Assigned To:
> Comments:
>
> I can't reproduce this. Could you please include an example script which
> demonstrates this behaviour? And maybe try the latest CVS snapshot
> from http://snaps.php.net/ too??
>
> --Jani
>
>
> Previous Comments:
> ---------------------------------------------------------------------------
>
> [2001-01-24 09:07:00] almico@almico.com
> gethostbyaddr returns the original IP when an error occurs, but this string is
> always 15 chars long. This means that if the original IP was shorter than that,
> garbage will appear at the end of the line. I've temporarily fixed it by passing
> an IP with 15 blanks added to its end.
>
> ---------------------------------------------------------------------------
>
>
> Full Bug description available at: http://bugs.php.net/?id=8884
Alfredo Milani-Comparetti
milani@mclink.it
milani@ascu.unian.it
Delphi home page --> http://www.almico.com/delphi
Elf home page --> http://radsite.com/elf