diff --git a/src/test/test-local-addresses.c b/src/test/test-local-addresses.c index bf89d3420c..2380f28d19 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));