diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-06-04 23:11:43 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-06-04 23:11:43 +0000 |
commit | 2df7f6110dc24b8d55e1c6c2c825fb2e393cdfb2 (patch) | |
tree | a8308b23899504202ffb5a1925373b719ca95e59 /sys | |
parent | 9aae5068afee870336e415b14d15b3d9dde81e34 (diff) |
add DLT_LOOP support; 4-byte header indicates proto; cstone@pobox.com
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/bpf.h | 3 | ||||
-rw-r--r-- | sys/net/if_loop.c | 6 |
2 files changed, 5 insertions, 4 deletions
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 } } |