Re: [PHP-DEV] PHP 4.0 Bug #8856 Updated: gethostbyname returns hostname instead of adress

2001-03-11 Thread Stig Venaas

On Sun, Mar 11, 2001 at 10:28:00PM -0800, [EMAIL PROTECTED] wrote:
  For at least some months, gethostbyname() in sockets.c has
  been replaced by gethostbyname() in ext/standard/dns.c
  which does
 
 sockets.c in ext/sockets? That has been #if 0'd out ever since it was
 originally written in there (I wrote it, not noticing that there was
 already one in the standard base. Oops.)

I wrote at least, because I didn't bother to check older sources.
Makes me wonder how the report could point to gethostbyname in
sockets.c

Thanks for the clarification,

Stig

-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #8856 Updated: gethostbyname returns hostname instead of adress

2001-03-10 Thread sniper

ID: 8856
Updated by: sniper
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Feedback
Bug Type: Network related
Assigned To: 
Comments:

Works for me just fine with latest CVS. Please try the 
latest CVS snapshot from http://snaps.php.net/

--Jani


Previous Comments:
---

[2001-01-23 12:28:11] [EMAIL PROTECTED]
The gethostbyname doesn't seem to work on some of the systems I use. The problem only 
occurs on some machines, others work fine. The problem only occurs on 4.0x, but not on 
3.0x on the same machine.
All machines use the same build of php4.

For example:
PHP
   echo (gethostbyname ("sql-1.vuurwerk.nl"));
?

Result:
sql-1.vuurwerk.nl

The bug? also affects functions like mysql_connect.
I am unable to connect to a sql server unless I replace the hostname with an ip 
adress.


I've traced the problem back to sockets.c, line 817:
a.s_addr = (int) (*(host_struct-h_addr_list[0]));


If I replace the code above with the equivalent code used in php3 the problem is 
solved:
memcpy (a.s_addr, *(host_struct-h_addr_list), sizeof (a.s_addr));


If you need more information please let me know.

Niels Leenheer
[EMAIL PROTECTED]

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8856edit=2


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #8856 Updated: gethostbyname returns hostname instead of adress

2001-03-10 Thread derick

ID: 8856
Updated by: derick
Reported By: [EMAIL PROTECTED]
Status: Feedback
Bug Type: Network related
Assigned To: 
Comments:

It sounds like a DNS problem to me. It would be wise if you check that out too.

Previous Comments:
---

[2001-03-10 16:12:27] [EMAIL PROTECTED]
Works for me just fine with latest CVS. Please try the 
latest CVS snapshot from http://snaps.php.net/

--Jani


---

[2001-01-23 12:28:11] [EMAIL PROTECTED]
The gethostbyname doesn't seem to work on some of the systems I use. The problem only 
occurs on some machines, others work fine. The problem only occurs on 4.0x, but not on 
3.0x on the same machine.
All machines use the same build of php4.

For example:
PHP
   echo (gethostbyname ("sql-1.vuurwerk.nl"));
?

Result:
sql-1.vuurwerk.nl

The bug? also affects functions like mysql_connect.
I am unable to connect to a sql server unless I replace the hostname with an ip 
adress.


I've traced the problem back to sockets.c, line 817:
a.s_addr = (int) (*(host_struct-h_addr_list[0]));


If I replace the code above with the equivalent code used in php3 the problem is 
solved:
memcpy (a.s_addr, *(host_struct-h_addr_list), sizeof (a.s_addr));


If you need more information please let me know.

Niels Leenheer
[EMAIL PROTECTED]

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8856edit=2


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #8856 Updated: gethostbyname returns hostname instead of adress

2001-03-10 Thread niels

ID: 8856
User Update by: [EMAIL PROTECTED]
Old-Status: Feedback
Status: Open
Bug Type: Network related
Description: gethostbyname returns hostname instead of adress

It sounds like a DNS problem to me. 
It would be wise if you check that out too.

I though about this too at first, but the right information is in both cases stored in 
the host_struct-h_addr_list.
But the information is only correct if you memcpy it to a.s_addr, instead of 
typecasting it.


Previous Comments:
---

[2001-03-10 16:30:21] [EMAIL PROTECTED]
It sounds like a DNS problem to me. It would be wise if you check that out too.

---

[2001-03-10 16:12:27] [EMAIL PROTECTED]
Works for me just fine with latest CVS. Please try the 
latest CVS snapshot from http://snaps.php.net/

--Jani


---

[2001-01-23 12:28:11] [EMAIL PROTECTED]
The gethostbyname doesn't seem to work on some of the systems I use. The problem only 
occurs on some machines, others work fine. The problem only occurs on 4.0x, but not on 
3.0x on the same machine.
All machines use the same build of php4.

For example:
PHP
   echo (gethostbyname ("sql-1.vuurwerk.nl"));
?

Result:
sql-1.vuurwerk.nl

The bug? also affects functions like mysql_connect.
I am unable to connect to a sql server unless I replace the hostname with an ip 
adress.


I've traced the problem back to sockets.c, line 817:
a.s_addr = (int) (*(host_struct-h_addr_list[0]));


If I replace the code above with the equivalent code used in php3 the problem is 
solved:
memcpy (a.s_addr, *(host_struct-h_addr_list), sizeof (a.s_addr));


If you need more information please let me know.

Niels Leenheer
[EMAIL PROTECTED]

---


Full Bug description available at: http://bugs.php.net/?id=8856


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP-DEV] PHP 4.0 Bug #8856 Updated: gethostbyname returns hostname instead of adress

2001-03-10 Thread venaas

ID: 8856
Updated by: venaas
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: Network related
Assigned To: 
Comments:

For at least some months, gethostbyname() in sockets.c has
been replaced by gethostbyname() in ext/standard/dns.c
which does

memcpy(in.s_addr, *(hp-h_addr_list), sizeof(in.s_addr));


Could you try the latest CVS? Could you test both
gethostbyname() and gethostbynamel() in PHP? They do it
differently. I think both should work.

Previous Comments:
---

[2001-03-10 17:13:23] [EMAIL PROTECTED]
It sounds like a DNS problem to me. 
It would be wise if you check that out too.

I though about this too at first, but the right information is in both cases stored in 
the host_struct-h_addr_list.
But the information is only correct if you memcpy it to a.s_addr, instead of 
typecasting it.


---

[2001-03-10 16:30:21] [EMAIL PROTECTED]
It sounds like a DNS problem to me. It would be wise if you check that out too.

---

[2001-03-10 16:12:27] [EMAIL PROTECTED]
Works for me just fine with latest CVS. Please try the 
latest CVS snapshot from http://snaps.php.net/

--Jani


---

[2001-01-23 12:28:11] [EMAIL PROTECTED]
The gethostbyname doesn't seem to work on some of the systems I use. The problem only 
occurs on some machines, others work fine. The problem only occurs on 4.0x, but not on 
3.0x on the same machine.
All machines use the same build of php4.

For example:
PHP
   echo (gethostbyname ("sql-1.vuurwerk.nl"));
?

Result:
sql-1.vuurwerk.nl

The bug? also affects functions like mysql_connect.
I am unable to connect to a sql server unless I replace the hostname with an ip 
adress.


I've traced the problem back to sockets.c, line 817:
a.s_addr = (int) (*(host_struct-h_addr_list[0]));


If I replace the code above with the equivalent code used in php3 the problem is 
solved:
memcpy (a.s_addr, *(host_struct-h_addr_list), sizeof (a.s_addr));


If you need more information please let me know.

Niels Leenheer
[EMAIL PROTECTED]

---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8856edit=2


-- 
PHP Development Mailing List http://www.php.net/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]