ID: 19508 User updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] Status: Open Bug Type: Sockets related Operating System: Solaris 6 PHP Version: 4CVS-2002-09-19 New Comment:
This is buggy in 4.2.3 as well as in CVS Previous Comments: ------------------------------------------------------------------------ [2002-09-19 17:22:43] [EMAIL PROTECTED] The current implementation of sockaddr_storage in main/php_network.h when an OS version is not available breaks word alignment of the structure. This showed up when compiling php w/ Sun Workshop Pro 4 & Forte 6 rather than gcc. A SIGBUG would occur when I was testing the ext/ftp extension. RFC2553's reference implementation put the max padding size at 128, which is also the size that fixed the problem in my tests. Here is a patch based off of today's cvs. I've also put in a check for sockaddr.sa_len into configure.in so the implementation of sockaddr_storage can vary. Though I'm not completely sure the padding is always correct when sa_len is found, as I dont have access to a system in that situation, but this is a step in the right direction if not the fix. Phil. Index: configure.in =================================================================== RCS file: /repository/php4/configure.in,v retrieving revision 1.372 diff -r1.372 configure.in 407a408,416 > dnl Check if sockaddr data structure includes a "sa_len" > AC_CHECK_MEMBER([struct sockaddr.sa_len], > [ AC_DEFINE(HAVE_SOCKADDR_LEN,1,[Whether sockaddr struct has sa_len]) ], > [], > [ > #include <sys/types.h> > #include <sys/socket.h> > ]) > Index: main/php_network.h =================================================================== RCS file: /repository/php4/main/php_network.h,v retrieving revision 1.27 diff -r1.27 php_network.h 87a88,91 > # ifdef HAVE_SOCKADDR_LEN > unsigned char ss_len; > unsigned char ss_family; > # else 89c93,94 < char info[256]; --- > # endif > char info[126]; ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=19508&edit=1