Module Name:    src
Committed By:   rmind
Date:           Sat May 30 21:00:31 UTC 2020

Modified Files:
        src/usr.sbin/npf/npftest/libnpftest: npf_test_subr.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 \
    src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c
diff -u src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c:1.17 src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c:1.18
--- src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c:1.17	Sat May 30 14:16:57 2020
+++ src/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c	Sat May 30 21:00:31 2020
@@ -64,6 +64,13 @@ npf_test_init(int (*pton_func)(int, cons
 {
 	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);

Reply via email to