Test Information

TitleReturn an error of EINVAL when the IPV6_UNICAST_HOPS option is set to less than -1
CommandLine./tst_hop_limit_set_to_lt_n1 --log=1.html --title=Return an error of EINVAL when the IPV6_UNICAST_HOPS option is set to less than -1
TestVersionREL_1_1_18
Start2023/02/03 01:00:11
SystemName(null)
KernelVersion(null)

Test Sequence Execution Log

01:00:11Start

== create an IPv6 socket ==
01:00:11socket(domain:AF_INET6, type:SOCK_STREAM, protocol:0)
01:00:11return sockfd=4

== get default hoplimit ==
01:00:11getsockopt(sockfd:4, level:IPPROTO_IPV6, optname:IPV6_UNICAST_HOPS, optval:0x3ffedaf853c, optlen:0x3ffedaf8538)
01:00:11return hoplimit=64

== set hoplimit to -2 ==
01:00:11setsockopt(sockfd:4, level:IPPROTO_IPV6, optname:IPV6_UNICAST_HOPS, optval:0x3ffedaf8540, optlen:4)
01:00:11return error EINVAL

== check whether hoplimit has been changed ==
01:00:11getsockopt(sockfd:4, level:IPPROTO_IPV6, optname:IPV6_UNICAST_HOPS, optval:0x3ffedaf8540, optlen:0x3ffedaf8538)
01:00:11return hoplimit=64

OK
01:00:11End