Skip to content

Commit c5f2082

Browse files
committed
being capable of setting the options
1 parent 29d6cc3 commit c5f2082

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

ext/sockets/sendrecvmsg.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,32 @@ int php_do_setsockopt_ipv6_rfc3542(php_socket *php_sock, int level, int optname,
371371

372372
optlen = sizeof(struct in6_pktinfo);
373373
goto dosockopt;
374+
#endif
375+
#ifndef PHP_WIN32 // set but seems more like for "future implementation" ?
376+
#ifdef IPV6_HOPOPTS
377+
case IPV6_HOPOPTS:
378+
opt_ptr = from_zval_run_conversions(arg4, php_sock, from_zval_write_ip6_hbh,
379+
sizeof(struct ip6_hbh), "ip6_hbh", &allocations, &err);
380+
if (err.has_error) {
381+
err_msg_dispose(&err);
382+
return FAILURE;
383+
}
384+
385+
optlen = sizeof(struct ip6_hbh);
386+
goto dosockopt;
387+
#endif
388+
#ifdef IPV6_DSTOPTS
389+
case IPV6_DSTOPTS:
390+
opt_ptr = from_zval_run_conversions(arg4, php_sock, from_zval_write_ip6_dest,
391+
sizeof(struct ip6_dest), "ip6_dest", &allocations, &err);
392+
if (err.has_error) {
393+
err_msg_dispose(&err);
394+
return FAILURE;
395+
}
396+
397+
optlen = sizeof(struct ip6_dest);
398+
goto dosockopt;
399+
#endif
374400
#endif
375401
}
376402

ext/sockets/sockets.stub.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,6 +1681,20 @@
16811681
*/
16821682
const IPPROTO_IPV6 = UNKNOWN;
16831683
#endif
1684+
#ifdef IPPROTO_UDP
1685+
/**
1686+
* @var int
1687+
* @cvalue IPPROTO_UDP
1688+
*/
1689+
const IPPROTO_UDP = UNKNOWN;
1690+
#endif
1691+
#ifdef IPPROTO_RAW
1692+
/**
1693+
* @var int
1694+
* @cvalue IPPROTO_RAW
1695+
*/
1696+
const IPPROTO_RAW = UNKNOWN;
1697+
#endif
16841698

16851699
/**
16861700
* @var int

ext/sockets/sockets_arginfo.h

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)