|  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
 [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



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-07 12:58 UTC]
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.

 [2002-05-07 15:14 UTC]
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at

sizeof(sockaddr_in) is the appropriate fix
 [2002-07-01 16:54 UTC]
Forgot to mark this one closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Jul 25 08:01:30 2024 UTC