OSDN Git Service

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