npftest -- npf_test_init(): add a workaround for NetBSD.

This commit is contained in:
rmind 2020-05-30 21:00:31 +00:00
parent 8727ac3ab2
commit 231831948d

View File

@ -64,6 +64,13 @@ npf_test_init(int (*pton_func)(int, const char *, void *),
{
npf_t *npf;
#ifdef __NetBSD__
// XXX: Workaround for npf_init()
if ((npf = npf_getkernctx()) != NULL) {
npf_worker_discharge(npf);
npf_worker_sysfini();
}
#endif
npfk_sysinit(0);
npf = npfk_create(0, &npftest_mbufops, &npftest_ifops, NULL);
npfk_thread_register(npf);