diff options
-rw-r--r-- | sbin/pflogd/pflogd.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sbin/pflogd/pflogd.c b/sbin/pflogd/pflogd.c index 52148c077cb..79fa7983fbc 100644 --- a/sbin/pflogd/pflogd.c +++ b/sbin/pflogd/pflogd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pflogd.c,v 1.17 2003/03/01 06:11:20 cloder Exp $ */ +/* $OpenBSD: pflogd.c,v 1.18 2003/03/11 02:35:34 kjc Exp $ */ /* * Copyright (c) 2001 Theo de Raadt @@ -161,13 +161,12 @@ init_pcap(void) return (-1); } - if (filter != NULL) { - if (pcap_compile(hpcap, &bprog, filter, PCAP_OPT_FIL, 0) < 0) - logmsg(LOG_WARNING, "%s", pcap_geterr(hpcap)); - else if (pcap_setfilter(hpcap, &bprog) < 0) - logmsg(LOG_WARNING, "%s", pcap_geterr(hpcap)); + if (pcap_compile(hpcap, &bprog, filter, PCAP_OPT_FIL, 0) < 0) + logmsg(LOG_WARNING, "%s", pcap_geterr(hpcap)); + else if (pcap_setfilter(hpcap, &bprog) < 0) + logmsg(LOG_WARNING, "%s", pcap_geterr(hpcap)); + if (filter != NULL) free(filter); - } if (pcap_datalink(hpcap) != DLT_PFLOG) { logmsg(LOG_ERR, "Invalid datalink type"); |