From 129d1ee26a72314f35ec2870b10af0b4a73d3e87 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Tue, 26 Jun 2001 17:45:58 +0000 Subject: deal with NULL rule being passed to logging --- sys/net/pf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sys/net/pf.c') diff --git a/sys/net/pf.c b/sys/net/pf.c index d3c715f61a7..cf556577fa0 100644 --- a/sys/net/pf.c +++ b/sys/net/pf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf.c,v 1.53 2001/06/26 15:58:42 provos Exp $ */ +/* $OpenBSD: pf.c,v 1.54 2001/06/26 17:45:57 provos Exp $ */ /* * Copyright (c) 2001, Daniel Hartmeier @@ -360,7 +360,7 @@ pflog_packet(struct mbuf *m, int af, u_short dir, u_short reason, u_short nr, struct pf_rule *rm) { #if NBPFILTER > 0 - struct ifnet *ifn, *ifp = rm->ifp; + struct ifnet *ifn, *ifp = NULL; struct pfloghdr hdr; struct mbuf m1; @@ -369,6 +369,8 @@ pflog_packet(struct mbuf *m, int af, u_short dir, u_short reason, hdr.af = htonl(af); /* Set the right interface name */ + if (rm != NULL) + ifp = rm->ifp; if (m->m_pkthdr.rcvif != NULL) ifp = m->m_pkthdr.rcvif; if (ifp != NULL) -- cgit v1.2.3