php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17074 Cannot bind() a socket to a specific port in FreeBSD
Submitted: 2002-05-07 10:48 UTC Modified: 2002-07-01 16:54 UTC
From: antonio dot bonifati at polimi dot it Assigned:
Status: Closed Package: Sockets related
PHP Version: 4.2.0 OS: FreeBSD
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: antonio dot bonifati at polimi dot it
New email:
PHP Version: OS:

 

 [2002-05-07 10:48 UTC] antonio dot bonifati at polimi dot it
please see also bug #10830
this bug hasn't been fixed yet in php 4.2.0
could you fix it?

i fixed it for myself changing the line 1001
in ext/sockets/sockets.c:

retval = bind(php_sock->bsd_socket, (struct sockaddr *)sa, sizeof(sa_storage));

with this one:

retval = bind(php_sock->bsd_socket, (struct sockaddr *)sa, sizeof(struct sockaddr));

it seems that the last parameter to bind is broken

best regards

Antonio

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-07 12:58 UTC] jason@php.net
Thanks for the report antonio.

From an initial glance, the fix you suggest looks correct, however, I still need to run it through a few tests.

Thanks,
-Jason
 [2002-05-07 15:14 UTC] jason@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/

sizeof(sockaddr_in) is the appropriate fix
 [2002-07-01 16:54 UTC] jason@php.net
Forgot to mark this one closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC