FreeBSD Bugzilla – Attachment 57 Details for
Bug 343
tcpdump with filter fails on tun and lo devices
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 3.08 KB, created by
jc
on 1995-04-14 09:20:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
jc
Created:
1995-04-14 09:20:01 UTC
Size:
3.08 KB
patch
obsolete
>*** sys/net/if_tun.c.orig Mon Apr 10 22:48:34 1995 >--- sys/net/if_tun.c Fri Apr 14 09:44:20 1995 >*************** >*** 117,123 **** > ifp->if_opackets = 0; > if_attach(ifp); > #if NBPFILTER > 0 >! bpfattach(&tunctl[i].tun_bpf, ifp, DLT_NULL, sizeof(u_int)); > #endif > } > } >--- 117,123 ---- > ifp->if_opackets = 0; > if_attach(ifp); > #if NBPFILTER > 0 >! bpfattach(&tunctl[i].tun_bpf, ifp, DLT_PPP, sizeof(u_int)); > #endif > } > } >*************** >*** 286,299 **** > #if NBPFILTER > 0 > if (tp->tun_bpf) { > /* >! * We need to prepend the address family as >! * a four byte field. Cons up a dummy header >! * to pacify bpf. This is safe because bpf >! * will only read from the mbuf (i.e., it won't >! * try to free it or keep a pointer to it). >! */ > struct mbuf m; >! u_int af = dst->sa_family; > > m.m_next = m0; > m.m_len = 4; >--- 286,298 ---- > #if NBPFILTER > 0 > if (tp->tun_bpf) { > /* >! * Dummy up a PPP link level header. >! * This is safe because bpf will only read from the >! * mbuf (i.e., it won't try to free it or keep a >! * pointer to it). >! */ > struct mbuf m; >! u_int af = htonl(0x0021); > > m.m_next = m0; > m.m_len = 4; >*************** >*** 510,523 **** > #if NBPFILTER > 0 > if (tunctl[unit].tun_bpf) { > /* >! * We need to prepend the address family as >! * a four byte field. Cons up a dummy header >! * to pacify bpf. This is safe because bpf >! * will only read from the mbuf (i.e., it won't >! * try to free it or keep a pointer to it). >! */ > struct mbuf m; >! u_int af = AF_INET; > > m.m_next = top; > m.m_len = 4; >--- 509,521 ---- > #if NBPFILTER > 0 > if (tunctl[unit].tun_bpf) { > /* >! * Dummy up a PPP link level header. >! * This is safe because bpf will only read from the >! * mbuf (i.e., it won't try to free it or keep a >! * pointer to it). >! */ > struct mbuf m; >! u_int af = (0x0021); > > m.m_next = top; > m.m_len = 4; >*** sys/net/if_loop.c.orig Mon Mar 20 16:26:39 1995 >--- sys/net/if_loop.c Fri Apr 14 09:44:31 1995 >*************** >*** 97,103 **** > ifp->if_addrlen = 0; > if_attach(ifp); > #if NBPFILTER > 0 >! bpfattach(&ifp->if_bpf, ifp, DLT_NULL, sizeof(u_int)); > #endif > } > >--- 97,103 ---- > ifp->if_addrlen = 0; > if_attach(ifp); > #if NBPFILTER > 0 >! bpfattach(&ifp->if_bpf, ifp, DLT_PPP, sizeof(u_int)); > #endif > } > >*************** >*** 119,132 **** > #if NBPFILTER > 0 > if (loif.if_bpf) { > /* >! * We need to prepend the address family as >! * a four byte field. Cons up a dummy header >! * to pacify bpf. This is safe because bpf >! * will only read from the mbuf (i.e., it won't >! * try to free it or keep a pointer a to it). >! */ > struct mbuf m0; >! u_int af = dst->sa_family; > > m0.m_next = m; > m0.m_len = 4; >--- 119,131 ---- > #if NBPFILTER > 0 > if (loif.if_bpf) { > /* >! * Dummy up a PPP link level header. >! * This is safe because bpf will only read from the >! * mbuf (i.e., it won't try to free it or keep a >! * pointer to it). >! */ > struct mbuf m0; >! u_int af = htonl(0x0021); > > m0.m_next = m; > m0.m_len = 4;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 343
: 57