Bug #63000 [Opn-]: MCAST_JOIN_GROUP on OSX is broken

2012-09-19 Thread lstrojny
Edit report at https://bugs.php.net/bug.php?id=63000edit=1

 ID: 63000
 Updated by: lstro...@php.net
 Reported by:igor at wiedler dot ch
 Summary:MCAST_JOIN_GROUP on OSX is broken
-Status: Open
+Status: To be documented
 Type:   Bug
 Package:Sockets related
 Operating System:   Mac OSX 10.7, 10.8
 PHP Version:5.4.6
 Block user comment: N
 Private report: N

 New Comment:

The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:

[2012-09-04 00:09:51] igor at wiedler dot ch

It's still broken on 10.8, also returning EINVAL.


[2012-09-03 20:08:14] cataphr...@php.net

What's the situation in OS X 10.8? I'd prefer not to disable this in versions 
where it's working.


[2012-09-03 05:42:37] larue...@php.net

reeze, this one is not like that one you reported.

that one is trivial, and in some situation it's not a bug ( empty user name is 
allowed in theory).

but this is a bug. (I didn't test with this, just judge by the reporting)


[2012-09-03 02:53:16] reeze dot xia at gmail dot com

I haven't use this option before, if it's an important feature,
if your patch didn't apply the only impact is the warning issued ?


that maybe need to be fixed, but if not...
eg this bug https://bugs.php.net/bug.php?id=62881 I reported.

maybe the bug reported may set to  won't fix :(

more conversation see: https://github.com/php/php-src/pull/176

anyway I prefer it get fixed :)


[2012-09-03 02:47:47] reeze dot xia at gmail dot com

Ah, you mention which version the bug exist, both 10.710.8 right ?

Is there any way to detect whether is broken or not 
disable it seems not a better choice.




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=63000


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63000edit=1


Bug #63000 [Opn]: MCAST_JOIN_GROUP on OSX is broken

2012-09-03 Thread cataphract
Edit report at https://bugs.php.net/bug.php?id=63000edit=1

 ID: 63000
 Updated by: cataphr...@php.net
 Reported by:igor at wiedler dot ch
 Summary:MCAST_JOIN_GROUP on OSX is broken
 Status: Open
 Type:   Bug
 Package:Sockets related
 Operating System:   Mac OSX 10.7, 10.8
 PHP Version:5.4.6
 Block user comment: N
 Private report: N

 New Comment:

What's the situation in OS X 10.8? I'd prefer not to disable this in versions 
where it's working.


Previous Comments:

[2012-09-03 05:42:37] larue...@php.net

reeze, this one is not like that one you reported.

that one is trivial, and in some situation it's not a bug ( empty user name is 
allowed in theory).

but this is a bug. (I didn't test with this, just judge by the reporting)


[2012-09-03 02:53:16] reeze dot xia at gmail dot com

I haven't use this option before, if it's an important feature,
if your patch didn't apply the only impact is the warning issued ?


that maybe need to be fixed, but if not...
eg this bug https://bugs.php.net/bug.php?id=62881 I reported.

maybe the bug reported may set to  won't fix :(

more conversation see: https://github.com/php/php-src/pull/176

anyway I prefer it get fixed :)


[2012-09-03 02:47:47] reeze dot xia at gmail dot com

Ah, you mention which version the bug exist, both 10.710.8 right ?

Is there any way to detect whether is broken or not 
disable it seems not a better choice.


[2012-09-02 21:41:13] igor at wiedler dot ch

See also: http://trac.videolan.org/vlc/ticket/6104#comment:19


[2012-09-02 21:38:36] igor at wiedler dot ch

Description:

The multicast support in PHP 5.4 makes use of MCAST_JOIN_GROUP if it is 
present. 
The problem is that OSX 10.7 added the constant, but did not correctly 
implement 
the feature. This causes the setsockopt call to fail.

The solution to the problem is to not use MCAST_JOIN_GROUP on OSX.

Test script:
---
?php
if (!extension_loaded('sockets')) {
die('skip sockets extension not available.');
}
if (PHP_OS !== 'Darwin') {
die('is not OSX.');
}

$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($socket, '0.0.0.0', 31057);

$so = socket_set_option($socket, IPPROTO_IP, MCAST_JOIN_GROUP, array(
group = '224.0.0.251',
interface = 0,
));
var_dump($so);


Expected result:

bool(true)

Actual result:
--
PHP Warning:  socket_set_option(): unable to set socket option [22]: Invalid 
argument in /Users/igor/code/react-mdns-userland/src/React/Mdns/Client.php on 
line 27
PHP Stack trace:
PHP   1. {main}() /Users/igor/code/react-mdns-userland/examples/client.php:0
PHP   2. React\Mdns\Client-query() /Users/igor/code/react-mdns-
userland/examples/client.php:10
PHP   3. socket_set_option() /Users/igor/code/react-mdns-
userland/src/React/Mdns/Client.php:27

bool(false)






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63000edit=1


Bug #63000 [Opn]: MCAST_JOIN_GROUP on OSX is broken

2012-09-02 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=63000edit=1

 ID: 63000
 Updated by: larue...@php.net
 Reported by:igor at wiedler dot ch
 Summary:MCAST_JOIN_GROUP on OSX is broken
 Status: Open
 Type:   Bug
 Package:Sockets related
 Operating System:   Mac OSX 10.7, 10.8
 PHP Version:5.4.6
 Block user comment: N
 Private report: N

 New Comment:

reeze, this one is not like that one you reported.

that one is trivial, and in some situation it's not a bug ( empty user name is 
allowed in theory).

but this is a bug. (I didn't test with this, just judge by the reporting)


Previous Comments:

[2012-09-03 02:53:16] reeze dot xia at gmail dot com

I haven't use this option before, if it's an important feature,
if your patch didn't apply the only impact is the warning issued ?


that maybe need to be fixed, but if not...
eg this bug https://bugs.php.net/bug.php?id=62881 I reported.

maybe the bug reported may set to  won't fix :(

more conversation see: https://github.com/php/php-src/pull/176

anyway I prefer it get fixed :)


[2012-09-03 02:47:47] reeze dot xia at gmail dot com

Ah, you mention which version the bug exist, both 10.710.8 right ?

Is there any way to detect whether is broken or not 
disable it seems not a better choice.


[2012-09-02 21:41:13] igor at wiedler dot ch

See also: http://trac.videolan.org/vlc/ticket/6104#comment:19


[2012-09-02 21:38:36] igor at wiedler dot ch

Description:

The multicast support in PHP 5.4 makes use of MCAST_JOIN_GROUP if it is 
present. 
The problem is that OSX 10.7 added the constant, but did not correctly 
implement 
the feature. This causes the setsockopt call to fail.

The solution to the problem is to not use MCAST_JOIN_GROUP on OSX.

Test script:
---
?php
if (!extension_loaded('sockets')) {
die('skip sockets extension not available.');
}
if (PHP_OS !== 'Darwin') {
die('is not OSX.');
}

$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($socket, '0.0.0.0', 31057);

$so = socket_set_option($socket, IPPROTO_IP, MCAST_JOIN_GROUP, array(
group = '224.0.0.251',
interface = 0,
));
var_dump($so);


Expected result:

bool(true)

Actual result:
--
PHP Warning:  socket_set_option(): unable to set socket option [22]: Invalid 
argument in /Users/igor/code/react-mdns-userland/src/React/Mdns/Client.php on 
line 27
PHP Stack trace:
PHP   1. {main}() /Users/igor/code/react-mdns-userland/examples/client.php:0
PHP   2. React\Mdns\Client-query() /Users/igor/code/react-mdns-
userland/examples/client.php:10
PHP   3. socket_set_option() /Users/igor/code/react-mdns-
userland/src/React/Mdns/Client.php:27

bool(false)






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63000edit=1