FreeBSD Bugzilla – Attachment 103649 Details for
Bug 143621
[ipfw] [dummynet] [patch] dummynet and vnet use results in panic
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.45 KB, created by
Gleb Kurtsou
on 2010-02-07 00:10:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
Gleb Kurtsou
Created:
2010-02-07 00:10:01 UTC
Size:
2.45 KB
patch
obsolete
>diff --git a/sys/netinet/ipfw/ip_dummynet.c b/sys/netinet/ipfw/ip_dummynet.c >index e961a55..4c169f3 100644 >--- a/sys/netinet/ipfw/ip_dummynet.c >+++ b/sys/netinet/ipfw/ip_dummynet.c >@@ -944,28 +944,49 @@ dummynet_send(struct mbuf *m) > m->m_nextpkt = NULL; > pkt = dn_tag_get(m); > switch (pkt->dn_dir) { >- case DN_TO_IP_OUT: >- ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); >+ case DN_TO_IP_OUT: { >+ VNET_ASSERT(pkt->ifp != NULL); >+ CURVNET_SET(pkt->ifp->if_vnet); >+ ip_output(m, NULL, NULL, IP_FORWARDING, >+ NULL, NULL); >+ CURVNET_RESTORE(); >+ } > break ; >- case DN_TO_IP_IN : >- ip = mtod(m, struct ip *); >- ip->ip_len = htons(ip->ip_len); >- ip->ip_off = htons(ip->ip_off); >- netisr_dispatch(NETISR_IP, m); >+ case DN_TO_IP_IN : { >+ VNET_ASSERT(m->m_pkthdr.rcvif != NULL); >+ CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); >+ ip = mtod(m, struct ip *); >+ ip->ip_len = htons(ip->ip_len); >+ ip->ip_off = htons(ip->ip_off); >+ netisr_dispatch(NETISR_IP, m); >+ CURVNET_RESTORE(); >+ } > break; > #ifdef INET6 >- case DN_TO_IP6_IN: >- netisr_dispatch(NETISR_IPV6, m); >+ case DN_TO_IP6_IN: { >+ VNET_ASSERT(m->m_pkthdr.rcvif != NULL); >+ CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); >+ netisr_dispatch(NETISR_IPV6, m); >+ CURVNET_RESTORE(); >+ } > break; > >- case DN_TO_IP6_OUT: >- ip6_output(m, NULL, NULL, IPV6_FORWARDING, NULL, NULL, NULL); >+ case DN_TO_IP6_OUT: { >+ VNET_ASSERT(pkt->ifp != NULL); >+ CURVNET_SET(pkt->ifp->if_vnet); >+ ip6_output(m, NULL, NULL, IPV6_FORWARDING, >+ NULL, NULL, NULL); >+ CURVNET_RESTORE(); >+ } > break; > #endif > case DN_TO_IFB_FWD: >- if (bridge_dn_p != NULL) >+ if (bridge_dn_p != NULL) { >+ VNET_ASSERT(pkt->ifp != NULL); >+ CURVNET_SET(pkt->ifp->if_vnet); > ((*bridge_dn_p)(m, pkt->ifp)); >- else >+ CURVNET_RESTORE(); >+ } else > printf("dummynet: if_bridge not loaded\n"); > > break; >@@ -981,10 +1002,19 @@ dummynet_send(struct mbuf *m) > "dropping packet\n"); > break; > } >- ether_demux(m->m_pkthdr.rcvif, m); >+ { >+ VNET_ASSERT(m->m_pkthdr.rcvif != NULL); >+ CURVNET_SET(m->m_pkthdr.rcvif->if_vnet); >+ ether_demux(m->m_pkthdr.rcvif, m); >+ CURVNET_RESTORE(); >+ } > break; >- case DN_TO_ETH_OUT: >- ether_output_frame(pkt->ifp, m); >+ case DN_TO_ETH_OUT: { >+ VNET_ASSERT(pkt->ifp != NULL); >+ CURVNET_SET(pkt->ifp->if_vnet); >+ ether_output_frame(pkt->ifp, m); >+ CURVNET_RESTORE(); >+ } > break; > > case DN_TO_DROP:
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 143621
: 103649