tests/sys/net/epair: don't leak the interface after the test

This commit is contained in:
Gleb Smirnoff 2022-01-26 21:08:50 -08:00
parent d35991d327
commit 942d05e3b8

View file

@ -64,7 +64,11 @@ ATF_TC_BODY(params, tc)
ifr.ifr_data = (caddr_t)-1;
(void) strlcpy(ifr.ifr_name, "epair", sizeof(ifr.ifr_name));
ioctl(s, SIOCIFCREATE2, &ifr);
if (ioctl(s, SIOCIFCREATE2, &ifr) < 0)
atf_tc_fail("Failed to create interface");
if (ioctl(s, SIOCIFDESTROY, &ifr) < 0)
atf_tc_fail("Failed to destroy interface");
}
ATF_TP_ADD_TCS(tp)