Module Name: src Committed By: nat Date: Mon Apr 27 23:05:31 UTC 2020
Modified Files: src/sys/net: pfil.c Log Message: Skip pfil_run_hooks if no packet filter configured in kernel. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/net/pfil.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/net/pfil.c diff -u src/sys/net/pfil.c:1.36 src/sys/net/pfil.c:1.37 --- src/sys/net/pfil.c:1.36 Sat Feb 1 02:54:31 2020 +++ src/sys/net/pfil.c Mon Apr 27 23:05:31 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pfil.c,v 1.36 2020/02/01 02:54:31 riastradh Exp $ */ +/* $NetBSD: pfil.c,v 1.37 2020/04/27 23:05:31 nat Exp $ */ /* * Copyright (c) 2013 Mindaugas Rasiukevicius <rmind at NetBSD org> @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.36 2020/02/01 02:54:31 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pfil.c,v 1.37 2020/04/27 23:05:31 nat Exp $"); #if defined(_KERNEL_OPT) #include "opt_net_mpsafe.h" @@ -398,6 +398,11 @@ pfil_run_hooks(pfil_head_t *ph, struct m int ret = 0; KASSERT(dir == PFIL_IN || dir == PFIL_OUT); + + if (__predict_false(ph == NULL)) { + return ret; + } + if (__predict_false((phlistset = pfil_hook_get(dir, ph)) == NULL)) { return ret; }