1 # etherspoof-2.7.diff -- kernel patch to spoof your source mac address
2 # OpenBSD 2.7 [diff version] by obecian <obecian@subterrain.net>
4 # based on earlier versions by:
5 # Copyright (c) 1999, 2000 Trevor Scheroeder <tschroed@zweknu.org>
6 # Copyright (c) 1998, 1999, 2000 Mike D. Schiffman <mike@infonexus.com>
7 # Original code and idea 1997 Thomas Ptacek <tqbf@pobox.com
9 # to patch kernel simply (as root):
11 # patch -p0 < etherspoof-2.7.diff
15 --- if_ethersubr.c.orig Sun May 7 11:39:34 2000
16 +++ if_ethersubr.c Sun May 7 11:44:33 2000
17 @@ -242,7 +242,7 @@ ether_output(ifp, m0, dst, rt0)
22 + u_char edst[6], esrc[6];
23 register struct mbuf *m = m0;
24 register struct rtentry *rt;
25 struct mbuf *mcopy = (struct mbuf *)0;
26 @@ -284,6 +284,7 @@ ether_output(ifp, m0, dst, rt0)
27 if ((m->m_flags & M_BCAST) && (ifp->if_flags & IFF_SIMPLEX))
28 mcopy = m_copy(m, 0, (int)M_COPYALL);
29 etype = htons(ETHERTYPE_IP);
30 + bcopy(ac->ac_enaddr, esrc, sizeof (edst));
34 @@ -453,7 +454,7 @@ ether_output(ifp, m0, dst, rt0)
36 eh = mtod(mcopy, struct ether_header *);
37 bcopy(edst, eh->ether_dhost, sizeof (edst));
38 - bcopy(ac->ac_enaddr, eh->ether_shost,
39 + bcopy(esrc, eh->ether_shost,
43 @@ -477,6 +478,7 @@ ether_output(ifp, m0, dst, rt0)
45 eh = (struct ether_header *)dst->sa_data;
46 bcopy((caddr_t)eh->ether_dhost, (caddr_t)edst, sizeof (edst));
47 + bcopy((caddr_t)eh->ether_shost, (caddr_t)esrc, sizeof (edst));
48 /* AF_UNSPEC doesn't swap the byte order of the ether_type. */
49 etype = eh->ether_type;
51 @@ -501,7 +503,7 @@ ether_output(ifp, m0, dst, rt0)
52 bcopy((caddr_t)&etype,(caddr_t)&eh->ether_type,
53 sizeof(eh->ether_type));
54 bcopy((caddr_t)edst, (caddr_t)eh->ether_dhost, sizeof (edst));
55 - bcopy((caddr_t)ac->ac_enaddr, (caddr_t)eh->ether_shost,
56 + bcopy((caddr_t)esrc, (caddr_t)eh->ether_shost,
57 sizeof(eh->ether_shost));