diff options
author | pattonme <pattonme@cvs.openbsd.org> | 1998-09-15 10:05:53 +0000 |
---|---|---|
committer | pattonme <pattonme@cvs.openbsd.org> | 1998-09-15 10:05:53 +0000 |
commit | 6afefb3a3fa727e36bf896a9638f23d65fc9e84e (patch) | |
tree | b9cddc59fc02c6fec18bdca069bd614d53e1944c /usr.sbin/ipftest/ipft_pc.c | |
parent | c0f676e69bfd829b82362fc6d313182c34d70937 (diff) |
updated to v3.2.9 of Darren's codebase. His code reimplements variable
locking, replaces u_long's with u_32_t to properly handle 64bit archs.
Wrapped OpenBSD specific preprocessor logic.
Diffstat (limited to 'usr.sbin/ipftest/ipft_pc.c')
-rw-r--r-- | usr.sbin/ipftest/ipft_pc.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/usr.sbin/ipftest/ipft_pc.c b/usr.sbin/ipftest/ipft_pc.c index 96fb0f08c7f..7cf6e934834 100644 --- a/usr.sbin/ipftest/ipft_pc.c +++ b/usr.sbin/ipftest/ipft_pc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipft_pc.c,v 1.10 1998/06/11 00:01:20 provos Exp $ */ +/* $OpenBSD: ipft_pc.c,v 1.11 1998/09/15 10:05:50 pattonme Exp $ */ /* * Copyright (C) 1993-1997 by Darren Reed. * @@ -27,14 +27,18 @@ #include <netinet/ip.h> #include <netinet/tcp.h> #include <net/if.h> -#include "ip_fil_compat.h" +#if defined(__OpenBSD__) +# include <netinet/ip_fil_compat.h> +#else +# include <netinet/ip_compat.h> +#endif #include <netinet/tcpip.h> #include "ipf.h" #include "ipt.h" #include "pcap.h" #if !defined(lint) -static const char rcsid[] = "@(#)$Id: ipft_pc.c,v 1.10 1998/06/11 00:01:20 provos Exp $"; +static const char rcsid[] = "@(#)$Id: ipft_pc.c,v 1.11 1998/09/15 10:05:50 pattonme Exp $"; #endif struct llc { @@ -47,9 +51,9 @@ struct llc { * While many of these maybe the same, some do have different header formats * which make this useful. */ -#define DLT_MAX 12 +#define DLT_MAX 14 -static struct llc llcs[DLT_MAX+1] = { +static struct llc llcs[DLT_MAX] = { { 0, 0, 0 }, /* DLT_NULL */ { 14, 12, 2 }, /* DLT_E10MB */ { 0, 0, 0 }, /* DLT_EN3MB */ @@ -118,7 +122,7 @@ char *fname; swap_hdr(&ph); } - if (ph.pc_v_maj != PCAP_VERSION_MAJ || ph.pc_type > DLT_MAX) { + if (ph.pc_v_maj != PCAP_VERSION_MAJ || ph.pc_type >= DLT_MAX) { (void) close(fd); return -2; } |