Skip to content

Commit f24a701

Browse files
lib: checksum: Fix build with CONFIG_NET=n
The generic ipv6 checksums are only defined with CONFIG_NET=y, so gate the test as well. Fixes: 6f4c45c ("kunit: Add tests for csum_ipv6_magic and ip_fast_csum") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202401192143.jLdjbIy3-lkp@intel.com/ Closes: https://lore.kernel.org/oe-kbuild-all/202401192357.WU4nPRdN-lkp@intel.com/ Reviewed-By: Charlie Jenkins <charlie@rivosinc.com> Link: https://lore.kernel.org/r/20240119145600.3093-2-palmer@rivosinc.com Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
1 parent 4525462 commit f24a701

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/checksum_kunit.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,7 @@ static void test_ip_fast_csum(struct kunit *test)
593593

594594
static void test_csum_ipv6_magic(struct kunit *test)
595595
{
596+
#if defined(CONFIG_NET)
596597
const struct in6_addr *saddr;
597598
const struct in6_addr *daddr;
598599
unsigned int len;
@@ -616,6 +617,7 @@ static void test_csum_ipv6_magic(struct kunit *test)
616617
CHECK_EQ(expected_csum_ipv6_magic[i],
617618
csum_ipv6_magic(saddr, daddr, len, proto, csum));
618619
}
620+
#endif /* !CONFIG_NET */
619621
}
620622

621623
static struct kunit_case __refdata checksum_test_cases[] = {

0 commit comments

Comments
 (0)