mirror of
https://github.com/torvalds/linux.git
synced 2026-12-05 04:44:03 +00:00
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: 6f4c45cbcb ("kunit: Add tests for csum_ipv6_magic and ip_fast_csum")
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Reviewed-By: Charlie Jenkins <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Palmer Dabbelt <[email protected]>
This commit is contained in:
@@ -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;
|
||||
@@ -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[] = {
|
||||
|
||||
Reference in New Issue
Block a user