From: Yu Watanabe Date: Thu, 3 Jul 2025 03:31:55 +0000 (+0900) Subject: test-local-addresses: enable IPv6 on the test interface X-Git-Tag: v258-rc1~196^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16eaed02bc29f54e6ddf173b4ac95c6cf31ee5ff;p=thirdparty%2Fsystemd.git test-local-addresses: enable IPv6 on the test interface If IPv6 is disabled by default, we need to explicitly enable IPv6 on the interface. Otherwise, adding an IPv6 address or route will fail. --- diff --git a/src/test/test-local-addresses.c b/src/test/test-local-addresses.c index bf89d3420c3..2380f28d19e 100644 --- a/src/test/test-local-addresses.c +++ b/src/test/test-local-addresses.c @@ -10,6 +10,7 @@ #include "in-addr-util.h" #include "local-addresses.h" #include "netlink-util.h" +#include "sysctl-util.h" #include "tests.h" static bool support_rta_via = false; @@ -217,6 +218,9 @@ TEST(local_addresses_with_dummy) { message = sd_netlink_message_unref(message); reply = sd_netlink_message_unref(reply); + /* Enable IPv6 for the case that it is disabled by default. */ + ASSERT_OK(sysctl_write_ip_property_boolean(AF_INET6, "test-local-addr", "disable_ipv6", false, /* shadow = */ NULL)); + /* Bring the interface up */ ASSERT_OK(sd_rtnl_message_new_link(rtnl, &message, RTM_SETLINK, ifindex)); ASSERT_OK(sd_rtnl_message_link_set_flags(message, IFF_UP, IFF_UP));