Index: head/tests/sys/net/routing/Makefile =================================================================== --- head/tests/sys/net/routing/Makefile +++ head/tests/sys/net/routing/Makefile @@ -14,4 +14,6 @@ # so running them in parallel will lead to weird results. TEST_METADATA+= is_exclusive=true +CFLAGS+= -I${.CURDIR:H:H:H} + .include Index: head/tests/sys/net/routing/rtsock_common.h =================================================================== --- head/tests/sys/net/routing/rtsock_common.h +++ head/tests/sys/net/routing/rtsock_common.h @@ -45,6 +45,7 @@ #include #include #include +#include #include #include #include @@ -63,6 +64,7 @@ #include #include +#include "freebsd_test_suite/macros.h" #include "rtsock_print.h" #include "params.h" @@ -126,33 +128,6 @@ return (found); } -/* - * Tries to ensure if_tap is loaded. - * Checks list of interface cloners first, then tries - * to load the module. - * - * return nonzero on success. - */ -static int -_enforce_cloner_loaded(char *cloner_name) -{ - if (_check_cloner(cloner_name)) - return (1); - /* need to load */ - RLOG("trying to load %s driver", cloner_name); - - char cmd[64]; - - snprintf(cmd, sizeof(cmd), "/sbin/kldload if_%s", cloner_name); - int ret = system(cmd); - if (ret != 0) { - RLOG("'%s' failed, error %d", cmd, ret); - return (0); - } - - return (1); -} - static char * iface_create(char *ifname_orig) { @@ -164,9 +139,6 @@ for (src = ifname_orig, dst = prefix; *src && isalpha(*src); src++) *dst++ = *src; *dst = '\0'; - - if (_enforce_cloner_loaded(prefix) == 0) - return (NULL); memset(&ifr, 0, sizeof(struct ifreq)); Index: head/tests/sys/net/routing/rtsock_config.h =================================================================== --- head/tests/sys/net/routing/rtsock_config.h +++ head/tests/sys/net/routing/rtsock_config.h @@ -127,6 +127,9 @@ inet_ntop(AF_INET6, &c->addr6.sin6_addr, c->addr6_str, INET6_ADDRSTRLEN); if (co->num_interfaces > 0) { + kldload("if_epair"); + ATF_REQUIRE_KERNEL_MODULE("if_epair"); + c->ifnames = calloc(co->num_interfaces, sizeof(char *)); for (int i = 0; i < co->num_interfaces; i++) c->ifnames[i] = iface_create("epair");