summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2004-01-27 09:31:15 +0000
committermarkus <markus@openbsd.org>2004-01-27 09:31:15 +0000
commit6898aa1c897751014ac02bf37ffa72048eab4b7c (patch)
tree238c11174cb4bcf6491cc6d0943b7560fd55556b
parentin gettdbbysrcdst(): hash by SRC and lookup SA in the tdbsrc[] hash table (diff)
downloadwireguard-openbsd-6898aa1c897751014ac02bf37ffa72048eab4b7c.tar.xz
wireguard-openbsd-6898aa1c897751014ac02bf37ffa72048eab4b7c.zip
drop packet if kif == NULL; ok henning deraadt
-rw-r--r--sys/net/pf.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 9024da00980..6e72226afc1 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.418 2004/01/06 20:24:33 dhartmei Exp $ */
+/* $OpenBSD: pf.c,v 1.419 2004/01/27 09:31:15 markus Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -5265,6 +5265,9 @@ pf_test(int dir, struct ifnet *ifp, struct mbuf **m0)
(m_tag_find(m, PACKET_TAG_PF_GENERATED, NULL) != NULL))
return (PF_PASS);
+ if (kif == NULL)
+ return (PF_DROP);
+
#ifdef DIAGNOSTIC
if ((m->m_flags & M_PKTHDR) == 0)
panic("non-M_PKTHDR is passed to pf_test");
@@ -5566,6 +5569,9 @@ pf_test6(int dir, struct ifnet *ifp, struct mbuf **m0)
(m_tag_find(m, PACKET_TAG_PF_GENERATED, NULL) != NULL))
return (PF_PASS);
+ if (kif == NULL)
+ return (PF_DROP);
+
#ifdef DIAGNOSTIC
if ((m->m_flags & M_PKTHDR) == 0)
panic("non-M_PKTHDR is passed to pf_test");