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/26 16:32:36
SystemName(null)
KernelVersion(null)

Test Sequence Execution Log

16:32:36Start

== Case1: Can not set odd value ==

== create an IPv6 raw socket ==
16:32:36socket(domain:AF_INET6, type:SOCK_RAW, protocol:IPPROTO_NONE)
16:32:36return sockfd=4

== set the value of IPV6_CHECKSUM option to 3 ==
16:32:36setsockopt(sockfd:4, level:IPPROTO_IPV6, optname:IPV6_CHECKSUM, optval:0x3ffeacf8bd8, optlen:4)
16:32:36return error EINVAL

== Case2: Default checksum option ==

== bind socket to address ==
16:32:36bind(sockfd:4, my_addr:0x3ffeacf8ca4, addrlen:28)
16:32:36return 0

== sendto message to interface lo ==
16:32:37sendto(sockfd:4, buf:0x3ffeacf8c40, len:100, flags:0, to:0x3ffeacf8ca4, tolen:28)
16:32:37return 100

== recv message on IPv6 socket ==
16:32:37recv(sockfd:4, buf:0x3ffeacf8bdc, len:100, flags:64)
16:32:37return 100

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

== set the value of IPV6_CHECKSUM option to 2 ==
16:32:37setsockopt(sockfd:4, level:IPPROTO_IPV6, optname:IPV6_CHECKSUM, optval:0x3ffeacf8bd8, optlen:4)
16:32:37return 0

== sendto message to interface lo ==
16:32:37sendto(sockfd:4, buf:0x3ffeacf8c40, len:100, flags:0, to:0x3ffeacf8ca4, tolen:28)
16:32:37return 100

== recv message on IPv6 socket ==
16:32:37recv(sockfd:4, buf:0x3ffeacf8bdc, len:100, flags:64)
16:32:37return 100

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

== create an IPv6 socket ==
16:32:37socket(domain:AF_INET6, type:SOCK_RAW, protocol:IPPROTO_NONE)
16:32:37return sockfd=5

== bind socket to address ==
16:32:37bind(sockfd:5, my_addr:0x3ffeacf8ca4, addrlen:28)
16:32:37return 0

== sendto message to interface lo ==
16:32:37sendto(sockfd:4, buf:0x3ffeacf8c40, len:100, flags:0, to:0x3ffeacf8ca4, tolen:28)
16:32:37return 100

== recv message on IPv6 socket ==
16:32:38recv(sockfd:5, buf:0x3ffeacf8bdc, len:100, flags:64)
16:32:38return 100
16:32:38close(5)
16:32:38close(4)

OK
16:32:38End