ext/sockets/tests/bug63000.phpt fails when multicast disabled
Nessuno ha ancora preso questa issue.
- Lingua principale
- C
- Stelle
- 40.4k
- Fork
- 8.2k
- Merge medio
- 2g 13h
- PR unite (30g)
- 96
Descrizione
Description
This test tries to set a multicast socket option,
$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);
but even on Linux, the ability to do so is not guaranteed. For example, if you run the test in its own network namespace,
$ unshare -n sapi/cli/php ./run-tests.php ext/sockets/tests/bug63000.phpt
you'll get an error,
---- EXPECTED OUTPUT
bool(true)
---- ACTUAL OUTPUT
Warning: socket_set_option(): Unable to set socket option [19]: No such device in ...bug63000.php on line 5
bool(false)
---- FAILED
The reason is that multicast first has to be enabled on a "new" network interface. Specifically, both of the following seem necessary,
$ ifconfig lo multicast
$ route add -net 224.0.0.0 netmask 224.0.0.0 lo
before the test will work.
I'm not really sure what the best way around this is. A simpler test for basic multicast support in SKIPIF?
PHP Version
php-8.2.8
Operating System
No response
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con ext/sockets/tests/bug63000.phpt ed eseguilo tramite sapi/cli/php con run-tests.php, incluso il caso unshare -n descritto nell’issue. Esamina il comportamento esistente del test e rendi appropriato il suo risultato quando multicast non è disponibile, mantenendo la copertura quando multicast è supportato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- php
- Ambito
- networking, testing-qa
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100