summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libpcap/gencode.c10
-rw-r--r--sys/net/bpf.h3
-rw-r--r--sys/net/if_loop.c6
-rw-r--r--usr.sbin/ipftest/ipft_pc.c10
-rw-r--r--usr.sbin/tcpdump/tcpdump.c3
5 files changed, 21 insertions, 11 deletions
diff --git a/lib/libpcap/gencode.c b/lib/libpcap/gencode.c
index 068d5642105..d6d323ab1a7 100644
--- a/lib/libpcap/gencode.c
+++ b/lib/libpcap/gencode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gencode.c,v 1.6 1997/07/25 20:30:18 mickey Exp $ */
+/* $OpenBSD: gencode.c,v 1.7 1998/06/04 23:11:34 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996
@@ -493,6 +493,11 @@ init_linktype(type)
off_nl = 0;
return;
+ case DLT_LOOP:
+ off_linktype = -1;
+ off_nl = 4;
+ return;
+
case DLT_PPP:
off_linktype = 2;
off_nl = 4;
@@ -575,10 +580,11 @@ gen_linktype(proto)
proto = 0x0021; /* XXX - need ppp.h defs */
break;
+ case DLT_LOOP:
case DLT_NULL:
/* XXX */
if (proto == ETHERTYPE_IP)
- return (gen_cmp(0, BPF_W, (bpf_int32)AF_INET));
+ return (gen_cmp(0, BPF_W, htonl((bpf_int32) AF_INET)));
else
return gen_false();
}
diff --git a/sys/net/bpf.h b/sys/net/bpf.h
index 12b5e3281b6..ad2ddda2a61 100644
--- a/sys/net/bpf.h
+++ b/sys/net/bpf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bpf.h,v 1.5 1997/03/17 16:29:37 niklas Exp $ */
+/* $OpenBSD: bpf.h,v 1.6 1998/06/04 23:11:37 deraadt Exp $ */
/* $NetBSD: bpf.h,v 1.15 1996/12/13 07:57:33 mikel Exp $ */
/*
@@ -179,6 +179,7 @@ struct bpf_hdr {
#define DLT_PPP 9 /* Point-to-point Protocol */
#define DLT_FDDI 10 /* FDDI */
#define DLT_ATM_RFC1483 11 /* LLC/SNAP encapsulated atm */
+#define DLT_LOOP 12 /* loopback type (af header) */
/*
* The instruction encondings.
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 5fed0ee1a61..51e575b3cf4 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_loop.c,v 1.8 1997/12/31 04:33:38 mickey Exp $ */
+/* $OpenBSD: if_loop.c,v 1.9 1998/06/04 23:11:38 deraadt Exp $ */
/* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */
/*
@@ -111,11 +111,11 @@ loopattach(n)
ifp->if_ioctl = loioctl;
ifp->if_output = looutput;
ifp->if_type = IFT_LOOP;
- ifp->if_hdrlen = 0;
+ ifp->if_hdrlen = 4;
ifp->if_addrlen = 0;
if_attachhead(ifp);
#if NBPFILTER > 0
- bpfattach(&ifp->if_bpf, ifp, DLT_NULL, sizeof(u_int));
+ bpfattach(&ifp->if_bpf, ifp, DLT_LOOP, sizeof(u_int));
#endif
}
}
diff --git a/usr.sbin/ipftest/ipft_pc.c b/usr.sbin/ipftest/ipft_pc.c
index a9319e7b932..f003bc34251 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.8 1998/01/26 04:16:35 dgregor Exp $ */
+/* $OpenBSD: ipft_pc.c,v 1.9 1998/06/04 23:11:40 deraadt Exp $ */
/*
* Copyright (C) 1993-1997 by Darren Reed.
*
@@ -34,7 +34,7 @@
#include "pcap.h"
#if !defined(lint)
-static const char rcsid[] = "@(#)$Id: ipft_pc.c,v 1.8 1998/01/26 04:16:35 dgregor Exp $";
+static const char rcsid[] = "@(#)$Id: ipft_pc.c,v 1.9 1998/06/04 23:11:40 deraadt Exp $";
#endif
struct llc {
@@ -47,7 +47,7 @@ struct llc {
* While many of these maybe the same, some do have different header formats
* which make this useful.
*/
-#define DLT_MAX 10
+#define DLT_MAX 12
static struct llc llcs[DLT_MAX+1] = {
{ 0, 0, 0 }, /* DLT_NULL */
@@ -60,7 +60,9 @@ static struct llc llcs[DLT_MAX+1] = {
{ 0, 0, 0 }, /* DLT_ARCNET */
{ 0, 0, 0 }, /* DLT_SLIP */
{ 0, 0, 0 }, /* DLT_PPP */
- { 0, 0, 0 } /* DLT_FDDI */
+ { 0, 0, 0 }, /* DLT_FDDI */
+ { 0, 0, 0 }, /* DLT_ATMRFC1483 */
+ { 0, 0, 0 } /* DLT_LOOP */
};
static int pcap_open __P((char *));
diff --git a/usr.sbin/tcpdump/tcpdump.c b/usr.sbin/tcpdump/tcpdump.c
index 06622b6a5fb..e2f849d3b6a 100644
--- a/usr.sbin/tcpdump/tcpdump.c
+++ b/usr.sbin/tcpdump/tcpdump.c
@@ -24,7 +24,7 @@ static const char copyright[] =
"@(#) Copyright (c) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996\n\
The Regents of the University of California. All rights reserved.\n";
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/tcpdump.c,v 1.7 1997/01/15 23:44:25 millert Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/tcpdump.c,v 1.8 1998/06/04 23:11:42 deraadt Exp $ (LBL)";
#endif
/*
@@ -98,6 +98,7 @@ static struct printer printers[] = {
{ fddi_if_print, DLT_FDDI },
{ null_if_print, DLT_NULL },
{ atm_if_print, DLT_ATM_RFC1483 },
+ { null_if_print, DLT_LOOP },
{ NULL, 0 },
};