Index: tests/sys/net/routing/Makefile =================================================================== --- tests/sys/net/routing/Makefile +++ 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: tests/sys/net/routing/rtsock_common.h =================================================================== --- tests/sys/net/routing/rtsock_common.h +++ 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) { @@ -165,9 +140,6 @@ *dst++ = *src; *dst = '\0'; - if (_enforce_cloner_loaded(prefix) == 0) - return (NULL); - memset(&ifr, 0, sizeof(struct ifreq)); s = socket(AF_LOCAL, SOCK_DGRAM, 0); Index: tests/sys/net/routing/rtsock_config.h =================================================================== --- tests/sys/net/routing/rtsock_config.h +++ tests/sys/net/routing/rtsock_config.h @@ -67,6 +67,9 @@ const char *key; int mask; + kldload("if_epair"); + ATF_REQUIRE_KERNEL_MODULE("if_epair"); + if (co == NULL) { bzero(&default_co, sizeof(default_co)); co = &default_co;