Test Information

TitleSet the IPV6_CHECKSUM socket option to have the kernel compute and store a checksum
CommandLine./tst_checksum_enable --log=1.html --title=Set the IPV6_CHECKSUM socket option to have the kernel compute and store a checksum
TestVersionREL_1_1_18
Start2023/01/17 08:40:47
SystemName(null)
KernelVersion(null)

Test Sequence Execution Log

08:40:47Start

== Case1: Can not set odd value ==

== create an IPv6 raw socket ==
08:40:47socket(domain:AF_INET6, type:SOCK_RAW, protocol:IPPROTO_NONE)
08:40:47return sockfd=4

== set the value of IPV6_CHECKSUM option to 3 ==
08:40:47setsockopt(sockfd:4, level:IPPROTO_IPV6, optname:IPV6_CHECKSUM, optval:0x7fff72e7838c, optlen:4)
08:40:47return error EINVAL

== Case2: Default checksum option ==

== bind socket to address ==
08:40:47bind(sockfd:4, my_addr:0x7fff72e78470, addrlen:28)
08:40:47return 0

== sendto message to interface lo ==
08:40:47sendto(sockfd:4, buf:0x7fff72e78400, len:100, flags:0, to:0x7fff72e78470, tolen:28)
08:40:47return 100

== recv message on IPv6 socket ==
08:40:47recv(sockfd:4, buf:0x7fff72e78390, len:100, flags:64)
08:40:47return 100

== Case3: checksum option is 2 and send to itself ==

== set the value of IPV6_CHECKSUM option to 2 ==
08:40:48setsockopt(sockfd:4, level:IPPROTO_IPV6, optname:IPV6_CHECKSUM, optval:0x7fff72e7838c, optlen:4)
08:40:48return 0

== sendto message to interface lo ==
08:40:48sendto(sockfd:4, buf:0x7fff72e78400, len:100, flags:0, to:0x7fff72e78470, tolen:28)
08:40:48return 100

== recv message on IPv6 socket ==
08:40:48recv(sockfd:4, buf:0x7fff72e78390, len:100, flags:64)
08:40:48return 100

== Case4: checksum option is 2 and send to another sock ==

== create an IPv6 socket ==
08:40:48socket(domain:AF_INET6, type:SOCK_RAW, protocol:IPPROTO_NONE)
08:40:48return sockfd=5

== bind socket to address ==
08:40:48bind(sockfd:5, my_addr:0x7fff72e78470, addrlen:28)
08:40:48return 0

== sendto message to interface lo ==
08:40:48sendto(sockfd:4, buf:0x7fff72e78400, len:100, flags:0, to:0x7fff72e78470, tolen:28)
08:40:48return 100

== recv message on IPv6 socket ==
08:40:48recv(sockfd:5, buf:0x7fff72e78390, len:100, flags:64)
08:40:48return 100
08:40:48close(5)
08:40:48close(4)

OK
08:40:48End