|
Lines 223-244
Link Here
|
| 223 |
} |
223 |
} |
| 224 |
|
224 |
|
| 225 |
/* Let BPF see incoming packet */ |
225 |
/* Let BPF see incoming packet */ |
| 226 |
if (ifp->if_bpf) { |
226 |
if (ifp->if_bpf) |
| 227 |
struct mbuf m0, *n = m; |
227 |
bpf_mtap(ifp, m); |
| 228 |
|
|
|
| 229 |
/* |
| 230 |
* We need to prepend the address family as |
| 231 |
* a four byte field. Cons up a dummy header |
| 232 |
* to pacify bpf. This is safe because bpf |
| 233 |
* will only read from the mbuf (i.e., it won't |
| 234 |
* try to free it or keep a pointer a to it). |
| 235 |
*/ |
| 236 |
m0.m_next = m; |
| 237 |
m0.m_len = 4; |
| 238 |
m0.m_data = (char *)⁡ |
| 239 |
n = &m0; |
| 240 |
bpf_mtap(ifp, n); |
| 241 |
} |
| 242 |
|
228 |
|
| 243 |
/* Strip away media header */ |
229 |
/* Strip away media header */ |
| 244 |
if (hlen > 0) { |
230 |
if (hlen > 0) { |