#include <netinet6/ip6_var.h>
#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)
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);
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);
}
* 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.
switch (sopt->sopt_name) {
default :
printf("dummynet: -- unknown option %d", sopt->sopt_name);
- error = EINVAL ;
+ error = EINVAL ;
break ;
case IP_DUMMYNET_GET :