OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / lib / Libnet / support / bpf-lkm / OpenBSD / README
1 ===============================================================================
2     LIBNET 1.0 (c) 1998 - 2001 Mike D. Schiffman <mike@infonexus.com>
3                                http://www.packetfactory.net/libnet
4 ===============================================================================
5
6
7     etherspoof kernel patch
8     OpenBSD 2.7
9
10     If you don't like messing with lkm's (see below), you can use this kernel
11     patch to enable your OpenBSD 2.7 box to forge Ethernet frames.
12
13     etherspoof lkm module
14     OpenBSD 2.4/2.5/2.6/2.7
15
16     Etherspoof is an lkm module that allows a bpf device to specify (forge)
17     arbitrary ethernet MAC addresses.  OpenBSD 2.4/2.5 port by route;
18     originally written by Thomas Ptacek.  His original readme contents follow.
19
20
21     1997 Thomas H. Ptacek
22
23     The 4.4BSD machine-independant ethernet driver does not allow upper layers
24     to forge the ethernet source address; all ethernet outputs cause the
25     output routine to build a new ethernet header, and the process that does
26     this explicitly copies the MAC address registered to the interface into
27     this header.
28
29     This is odd, because the bpf writing convention asserts that writes to bpf
30     must include a link-level header; it's intuitive to assume that this
31     header is, along with the rest of the packet data, written to the wire.
32
33     This is not the case, though. The link-layer header is used solely by the
34     bpf code, in order to build a sockaddr structure that is passed to the
35     generic ethernet output routine; the header is then effectively stripped
36     off the packet. The ethernet output routine consults this sockaddr to
37     obtain the ethernet type and destination address, but not the source
38     address.
39
40     This code is a slightly modified version of FreeBSD 3.0's original
41     ethernet output routine. The sole difference is that this output routine
42     retrieves the source ethernet address from the sockaddr, and uses it as
43     the source address for the header written the wire. This allows bpf to be
44     used to seamlessly forge ethernet packets in their entirety, which has
45     applications in address management. 
46
47     The modload glue provided traverses the global list of system interfaces,
48     and replaces any pointer to the original ethernet output routine with the
49     new one we've provided. The unload glue undoes this. The effect of
50     loading this module will be that all ethernet interfaces on the system
51     will support source address forging.
52
53 EOF