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/02/03 01:00:45
SystemName(null)
KernelVersion(null)

Test Sequence Execution Log

01:00:45Start

== Case1: Can not set odd value ==

== create an IPv6 raw socket ==
01:00:45socket(domain:AF_INET6, type:SOCK_RAW, protocol:IPPROTO_NONE)
01:00:45return sockfd=4

== set the value of IPV6_CHECKSUM option to 3 ==
01:00:45setsockopt(sockfd:4, level:IPPROTO_IPV6, optname:IPV6_CHECKSUM, optval:0x3ffcf0f90d8, optlen:4)
01:00:45return error EINVAL

== Case2: Default checksum option ==

== bind socket to address ==
01:00:45bind(sockfd:4, my_addr:0x3ffcf0f91a4, addrlen:28)
01:00:45return 0

== sendto message to interface lo ==
01:00:45sendto(sockfd:4, buf:0x3ffcf0f9140, len:100, flags:0, to:0x3ffcf0f91a4, tolen:28)
01:00:45return 100

== recv message on IPv6 socket ==
01:00:45recv(sockfd:4, buf:0x3ffcf0f90dc, len:100, flags:64)
01:00:45return 100

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

== set the value of IPV6_CHECKSUM option to 2 ==
01:00:46setsockopt(sockfd:4, level:IPPROTO_IPV6, optname:IPV6_CHECKSUM, optval:0x3ffcf0f90d8, optlen:4)
01:00:46return 0

== sendto message to interface lo ==
01:00:46sendto(sockfd:4, buf:0x3ffcf0f9140, len:100, flags:0, to:0x3ffcf0f91a4, tolen:28)
01:00:46return 100

== recv message on IPv6 socket ==
01:00:46recv(sockfd:4, buf:0x3ffcf0f90dc, len:100, flags:64)
01:00:46return 100

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

== create an IPv6 socket ==
01:00:46socket(domain:AF_INET6, type:SOCK_RAW, protocol:IPPROTO_NONE)
01:00:46return sockfd=5

== bind socket to address ==
01:00:46bind(sockfd:5, my_addr:0x3ffcf0f91a4, addrlen:28)
01:00:46return 0

== sendto message to interface lo ==
01:00:46sendto(sockfd:4, buf:0x3ffcf0f9140, len:100, flags:0, to:0x3ffcf0f91a4, tolen:28)
01:00:46return 100

== recv message on IPv6 socket ==
01:00:46recv(sockfd:5, buf:0x3ffcf0f90dc, len:100, flags:64)
01:00:46return 100
01:00:46close(5)
01:00:46close(4)

OK
01:00:46End