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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
10 + 48 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 20 14:01:29 2024 UTC