Skip to content

Commit fe47472

Browse files
committed
update 32 bits tests
1 parent cf9605c commit fe47472

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

ext/sockets/tests/socket_afpacket32.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,22 @@ if (PHP_INT_SIZE != 4) die("skip this test is for 32-bit only");
4040
echo $e->getMessage(), PHP_EOL;
4141
}
4242

43+
socket_close($s_c);
44+
// purposely unsupported ethernet protocol (ARP)
45+
46+
$s_c = socket_create(AF_PACKET, SOCK_RAW, 0x0806);
47+
$s_bind = socket_bind($s_c, 'lo');
48+
$buf = pack("H12H12n", "ffffffffffff", "000000000000", 0x0806);
49+
$buf .= str_repeat("A", 46);
50+
51+
var_dump(socket_sendto($s_s, $buf, strlen($buf), 0, "lo", 1));
52+
53+
try {
54+
socket_recvfrom($s_c, $rsp2, strlen($buf), 0, $addr2);
55+
} catch (\ValueError $e) {
56+
echo $e->getMessage(), PHP_EOL;
57+
}
58+
4359
socket_close($s_s);
4460
socket_close($s_c);
4561
?>
@@ -48,4 +64,7 @@ bool(true)
4864
bool(true)
4965
string(2) "lo"
5066
int(%d)
67+
int(%d)
5168
invalid transport header length
69+
int(60)
70+
unsupported ethernet protocol

0 commit comments

Comments
 (0)