Page MenuHomeFreeBSD

D24468.id70693.diff
No OneTemporary

D24468.id70693.diff

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 <bsd.test.mk>
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 <sys/socket.h>
#include <sys/ioctl.h>
#include <sys/jail.h>
+#include <sys/linker.h>
#include <net/if.h>
#include <net/if_dl.h>
#include <net/route.h>
@@ -63,6 +64,7 @@
#include <sysexits.h>
#include <atf-c.h>
+#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
@@ -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");

File Metadata

Mime Type
text/plain
Expires
Sun, Feb 1, 5:19 AM (8 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28283168
Default Alt Text
D24468.id70693.diff (2 KB)

Event Timeline