tst_recv_hhopt - Receive Hop-by-Hop Options when the IPV6_RECVHOPOPTS socket option is enabled
To check that if enable the IPV6_RECVHOPOPTS socket option, the application can receive Hop-by-Hop options header.
./tst_recv_hhopt [-tooloption ...] -tooloption : v6api tool option
1. Create an IPv6 socket 2. Enable socket to receive Hop-by-Hop options 3. Set Hop-by-Hop options header of socket 4. Bind socket to address 5. Send message to itself 6. Receive message on socket 7. Check A: Hop-by-Hop option can be received
None
RFC 3542
8.1. Receiving Hop-by-Hop Options
To receive a Hop-by-Hop options header the application must enable the IPV6_RECVHOPOPTS socket option:
int on = 1; setsockopt(fd, IPPROTO_IPV6, IPV6_RECVHOPOPTS, &on, sizeof(on));
When using ancillary data a Hop-by-hop options header is passed between the application and the kernel as follows: The cmsg_level member will be IPPROTO_IPV6 and the cmsg_type member will be IPV6_HOPOPTS. These options are then processed by calling the inet6_opt_next(), inet6_opt_find(), and inet6_opt_get_val() functions, described in Section 10.