$socket = socket_create(AF_INET6, SOCK_RAW, 58);socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 1, 'usec' => 0));$type = chr(135);$code = chr(0);$check = chr(0);$check...
$socket = socket_create(AF_INET6, SOCK_RAW, 58);
socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, array('sec' => 1, 'usec' => 0));
$type = chr(135);
$code = chr(0);
$check = chr(0);
$check .= chr(0);
$reserverd = chr(0) . chr(0) . chr(0) . chr(0);
$distMul = "ff02::1:ff26:13dc"; //solicitation node multicast address
$target = "fe80::3b40:f032:5726:13dc";
$id = inet_pton($target);
socket_set_option($socket, IPPROTO_IPV6, IPV6_MULTICAST_HOPS, 255);
$package = $type . $code . $check . $reserverd . $id;
socket_connect($socket, $distMul, 0);
socket_send($socket, $package, strlen($package), 0);
$str = socket_read($socket, 2048);
socket_close($socket);
以上是发送 ICMPv6 请求的脚本。这是 Wireshark 捕获。
问题是,请求从未得到任何答复,根据 IPV6 文档,脚本应该得到“邻居广告(类型 136)”答复,但这并没有发生。