Skip to content

Commit

Permalink
lib: checksum: Fix build with CONFIG_NET=n
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Palmer Dabbelt committed Jan 19, 2024
1 parent 4525462 commit f24a701
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/checksum_kunit.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ static void test_ip_fast_csum(struct kunit *test)

static void test_csum_ipv6_magic(struct kunit *test)
{
#if defined(CONFIG_NET)
const struct in6_addr *saddr;
const struct in6_addr *daddr;
unsigned int len;
Expand All @@ -616,6 +617,7 @@ static void test_csum_ipv6_magic(struct kunit *test)
CHECK_EQ(expected_csum_ipv6_magic[i],
csum_ipv6_magic(saddr, daddr, len, proto, csum));
}
#endif /* !CONFIG_NET */
}

static struct kunit_case __refdata checksum_test_cases[] = {
Expand Down

0 comments on commit f24a701

Please sign in to comment.