Skip to content

Commit ff0eabe

Browse files
committed
add basic test
1 parent 2ab8900 commit ff0eabe

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
--TEST--
2+
socket_setopt() with SOL_PACKET
3+
--EXTENSIONS--
4+
sockets
5+
posix
6+
--SKIPIF--
7+
<?php if (!defined("SOL_PACKET")) die('SKIP SOL_PACKET not supported on this platform.');
8+
if (!function_exists("posix_getuid") || posix_getuid() != 0) die('SKIP AF_PACKET requires root permissions.');
9+
?>
10+
--FILE--
11+
<?php
12+
$s = socket_create(AF_PACKET, SOCK_RAW, ETH_P_ALL);
13+
var_dump($s);
14+
var_dump(socket_setopt($s, SOL_PACKET, PACKET_FANOUT, PACKET_FANOUT_LB));
15+
socket_close($s);
16+
?>
17+
--EXPECTF--
18+
object(Socket)#1 (0) {
19+
}
20+
bool(true)
21+

0 commit comments

Comments
 (0)