Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/npf/npftest/libnpftest npftest -- npf_test_init(): ...



details:   https://anonhg.NetBSD.org/src/rev/47f89262b5a0
branches:  trunk
changeset: 972589:47f89262b5a0
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sat May 30 21:00:31 2020 +0000

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

diffstat:

 usr.sbin/npf/npftest/libnpftest/npf_test_subr.c |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (17 lines):

diff -r 09b1017ad190 -r 47f89262b5a0 usr.sbin/npf/npftest/libnpftest/npf_test_subr.c
--- a/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c   Sat May 30 20:54:54 2020 +0000
+++ b/usr.sbin/npf/npftest/libnpftest/npf_test_subr.c   Sat May 30 21:00:31 2020 +0000
@@ -64,6 +64,13 @@
 {
        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);



Home | Main Index | Thread Index | Old Index