X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=dummynet%2Fip_dummynet.c;h=836d1e178d4b75d02a8fc1d3c77731858a034fba;hb=1f3693d89c1c88e895721e21751c354e74b99627;hp=a613bbfd9120f13c1288541eb0faab6d3fbe52c0;hpb=3f06507f45547df04f6be56c4bcb02dce9d2d316;p=ipfw.git diff --git a/dummynet/ip_dummynet.c b/dummynet/ip_dummynet.c index a613bbf..836d1e1 100644 --- a/dummynet/ip_dummynet.c +++ b/dummynet/ip_dummynet.c @@ -86,6 +86,7 @@ __FBSDID("$FreeBSD: src/sys/netinet/ip_dummynet.c,v 1.110.2.4 2008/10/31 12:58:1 #include #include "missing.h" + /* * We keep a private variable for the simulation time, but we could * probably use an existing one ("softticks" in sys/kern/kern_timeout.c) @@ -959,6 +960,7 @@ dummynet_send(struct mbuf *m) pkt = dn_tag_get(m); dst = pkt->dn_dir; } + switch (dst) { case DN_TO_IP_OUT: ip_output(m, NULL, NULL, IP_FORWARDING, NULL, NULL); @@ -1538,7 +1540,7 @@ dropit: pkt = dn_tag_get(m); pkt->dn_dir = DN_TO_DROP; } - dummynet_send(m); /* drop the packet */ + dummynet_send(m); /* drop the packet */ *m0 = NULL; return ((fs && (fs->flags_fs & DN_NOERROR)) ? 0 : ENOBUFS); } @@ -1547,9 +1549,15 @@ dropit: * Below, the rt_unref is only needed when (pkt->dn_dir == DN_TO_IP_OUT) * Doing this would probably save us the initial bzero of dn_pkt */ -#define DN_FREE_PKT(_m) do { \ +#if defined( __linux__ ) +#define DN_FREE_PKT(_m) do { \ + netisr_dispatch(-1, _m); \ +} while (0) +#else +#define DN_FREE_PKT(_m) do { \ m_freem(_m); \ } while (0) +#endif /* * Dispose all packets and flow_queues on a flow_set. @@ -2270,7 +2278,7 @@ ip_dn_ctl(struct sockopt *sopt) switch (sopt->sopt_name) { default : printf("dummynet: -- unknown option %d", sopt->sopt_name); - error = EINVAL ; + error = EINVAL ; break ; case IP_DUMMYNET_GET :