1 ===============================================================================
2 LIBNET 1.0 (c) 1998, 1999, 2000 Mike D. Schiffman <mike@infonexus.com>
3 http://www.packetfactory.net/libnet
4 ===============================================================================
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
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
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.
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
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.
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.