Commit graph

5 commits

Author SHA1 Message Date
Gleb Smirnoff 942d05e3b8 tests/sys/net/epair: don't leak the interface after the test 2022-01-26 21:08:50 -08:00
Olivier Cochard 8ccf503240 Skip if_epair regression test if module doesn't exist
Approved by:	kp
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D23876
2020-03-03 17:35:15 +00:00
Kristof Provost 50214f86c5 tests: epair: Don't fail if we load if_epair
kldload() returns a positive integer when it loads a ko, so check that the
return value is -1 to detect error cases, not that it's different from zero.

MFC after:	3 days
X-MFC-With:	r357234
2020-02-01 19:40:11 +00:00
Kristof Provost 7bde621ba3 tests: epair: Don't fail if the if_epair module is already loaded
kldload() returns an error (EEXIST) if the module is already loaded.
That's not a problem for us, so ignore that error.

While here also clean up include statements.

MFC after:	3 days
X-MFC-With:	r357234
2020-02-01 11:31:45 +00:00
Kristof Provost 5458a63bca tests: Test for an epair panic
if_epair abused the ifr_data field to insert its second interface in
IFC_IFLIST. If userspace provides a value for ifr_data it would get
dereferenced by the kernel leading to a panic.

Reported by:	Ilja Van Sprundel <ivansprundel@ioactive.com>
MFC after:	3 days
2020-01-28 22:46:51 +00:00