diff options
author | Micael Karlberg <[email protected]> | 2018-07-23 18:26:42 +0200 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2018-09-18 14:50:18 +0200 |
commit | de82310c32063b8556add3fe7cf62b26eef27841 (patch) | |
tree | 7f07bf03f590fabe32b482a2c1a7ff2739dbe071 /lib/kernel/test | |
parent | 4d14b84183c3c17f0ec03bf3631f1fd8575f07b9 (diff) | |
download | otp-de82310c32063b8556add3fe7cf62b26eef27841.tar.gz otp-de82310c32063b8556add3fe7cf62b26eef27841.tar.bz2 otp-de82310c32063b8556add3fe7cf62b26eef27841.zip |
[socket-nif] Add support for socket (level ipv6) option recvpktinfo
Added support for the IPv6 socket option RECVPKTINFO.
This option is called PKTINFO on FreeBSD, so that value
will also be accepted.
OTP-14831.
Diffstat (limited to 'lib/kernel/test')
-rw-r--r-- | lib/kernel/test/socket_server.erl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/kernel/test/socket_server.erl b/lib/kernel/test/socket_server.erl index f3f397aa20..ba74964ed1 100644 --- a/lib/kernel/test/socket_server.erl +++ b/lib/kernel/test/socket_server.erl @@ -154,7 +154,7 @@ do_manager_init(Domain, dgram = Type, Proto, Peek) -> addr => Addr}, i("try bind to: " "~n ~p", [Addr]), - case socket:bind(Sock, any) of + case socket:bind(Sock, SA) of {ok, _P} -> ok; {error, BReason} -> @@ -620,6 +620,7 @@ handler_init(Manager, ID, Peek, Sock) -> MHops = GIP6(multicast_hops), MIF6 = GIP6(multicast_if), % Only dgram and raw MLoop6 = GIP6(multicast_loop), + RecvPktInfo = GIP6(recvpktinfo), i("got continue when: " "~n (socket) Domain: ~p" "~n (socket) Type: ~p" @@ -650,14 +651,16 @@ handler_init(Manager, ID, Peek, Sock) -> "~n (ip) Recv TTL: ~s" "~n (ipv6) Multicast Hops: ~s" "~n (ipv6) Multicast IF: ~s" - "~n (ipv6) Multicast Loop: ~s", + "~n (ipv6) Multicast Loop: ~s" + "~n (ipv6) Recv Pkt Info: ~s", [Domain, Type, Proto, RA, RP, B2D, OOBI, RcvBuf, RcvLW, RcvTO, SndBuf, SndLW, SndTO, Linger, Timestamp, FreeBind, MTU, MTUDisc, MALL, MIF4, MLoop4, MTTL, NF, RecvIF, RecvOPTS, RecvTOS, RecvTTL, - MHops, MIF6, MLoop6]), + MHops, MIF6, MLoop6, + RecvPktInfo]), handler_loop(#handler{peek = Peek, manager = Manager, @@ -665,6 +668,7 @@ handler_init(Manager, ID, Peek, Sock) -> socket = Sock}) end. + handler_loop(H) -> i("try read message"), case recv(H) of |