Doc #53851 [Opn]: socket_create protocol int (IPv6)
| From: | spandit at stealth dot net | Date: | Wed, 26 Jan 2011 22:39:29 +0000 |
| Subject: | Doc #53851 [Opn]: socket_create protocol int (IPv6) | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-5871@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=53851&edit=1
ID: 53851
User updated by: spandit at stealth dot net
Reported by: spandit at stealth dot net
Summary: socket_create protocol int (IPv6)
Status: Open
Type: Documentation Problem
Package: Documentation problem
Operating System: FreeBSD 8.x
PHP Version: 5.3.5
Block user comment: N
Private report: N
New Comment:
Discard; Perhaps the doc should just be updated to include some IPv6
protocols
(e.g. ipv6-icmp)
Previous Comments:
------------------------------------------------------------------------
[2011-01-26 23:36:22] spandit at stealth dot net
Description:
------------
---
From manual page: http://www.php.net/function.socket-create#Parameters
---
The protocol section needs to be updated to account for the IPv6
protocol numbers.
For example, calling getprotobyname('icmp') returns 1; or users would
enter '1'
for ICMP. For IPv6, this would be '58'. To open a raw socket for a
ICMPv6, the
command would be: socket_create(AF_INET6, SOCK_RAW, '58');
Test script:
---------------
<?php
$package = "\x08\x00\x7d\x4b\x00\x00\x00\x00Howdy";
// Write fails in this test
$socket = socket_create(AF_INET6, SOCK_RAW, 1);
socket_write($socket, $package, strlen($package));
// Write successful in this test
$socket = socket_create(AF_INET6, SOCK_RAW, 58);
socket_write($socket, $package, strlen($package));
Expected result:
----------------
See above
Actual result:
--------------
See above
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53851&edit=1