From 86b92cfc6b5f945e91bb95b870808f2541a01b5b Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 26 Jun 2001 22:51:04 +0000 Subject: fix PFRES_MAX handling --- sys/net/pfvar.h | 4 ++-- usr.sbin/tcpdump/print-pflog.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sys/net/pfvar.h b/sys/net/pfvar.h index 9f1a898e924..80a79a1b673 100644 --- a/sys/net/pfvar.h +++ b/sys/net/pfvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pfvar.h,v 1.19 2001/06/26 22:26:13 deraadt Exp $ */ +/* $OpenBSD: pfvar.h,v 1.20 2001/06/26 22:51:02 deraadt Exp $ */ /* * Copyright (c) 2001, Daniel Hartmeier @@ -127,7 +127,7 @@ struct pf_rdr { #define PFRES_BADOFF 1 /* Bad offset for pull_hdr */ #define PFRES_FRAG 2 /* Dropping following fragment */ #define PFRES_SHORT 3 /* Dropping short packet */ -#define PFRES_MAX 3 /* total */ +#define PFRES_MAX 4 /* total+1 */ #define PFRES_NAMES { \ "match", \ diff --git a/usr.sbin/tcpdump/print-pflog.c b/usr.sbin/tcpdump/print-pflog.c index 828253e1b7f..1c80eae1571 100644 --- a/usr.sbin/tcpdump/print-pflog.c +++ b/usr.sbin/tcpdump/print-pflog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-pflog.c,v 1.5 2001/06/26 22:26:14 deraadt Exp $ */ +/* $OpenBSD: print-pflog.c,v 1.6 2001/06/26 22:51:03 deraadt Exp $ */ /* * Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996 @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-pflog.c,v 1.5 2001/06/26 22:26:14 deraadt Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-pflog.c,v 1.6 2001/06/26 22:51:03 deraadt Exp $ (LBL)"; #endif #include @@ -84,7 +84,7 @@ pflog_if_print(u_char *user, const struct pcap_pkthdr *h, hdr = (struct pfloghdr *)p; res = ntohs(hdr->reason); - why = (res <= PFRES_MAX) ? pf_reasons[res] : "unkn"; + why = (res < PFRES_MAX) ? pf_reasons[res] : "unkn"; snprintf(reason, sizeof(reason), "%d(%s)", res, why); -- cgit v1.2.3