[pf4freebsd] Patch: if_tun.c (forgot the polling)
Max Laier
max at love2party.net
Wed Sep 15 20:43:59 PDT 2004
Here is a patch for if_tun.c. This should finally enable tun(4) for
queueing. In my earlier patch sent to Dennis I forgot to modify the polling
as well:
<snip>
@@ -838,12 +861,14 @@
struct tun_softc *tp = dev->si_drv1;
struct ifnet *ifp = &tp->tun_if;
int revents = 0;
+ struct mbuf *m;
s = splimp();
TUNDEBUG("%s%d: tunpoll\n", ifp->if_name, ifp->if_unit);
if (events & (POLLIN | POLLRDNORM)) {
- if (ifp->if_snd.ifq_len > 0) {
+ IFQ_POLL_NOLOCK(&ifp->if_snd, m);
+ if (m != NULL) {
TUNDEBUG("%s%d: tunpoll q=%d\n", ifp->if_name,
ifp->if_unit, ifp->if_snd.ifq_len);
revents |= events & (POLLIN | POLLRDNORM);
<snap>
I hope this now really does the trick. Tests with Daniel's ACKPRI-Tutorial
show good results.
@Dennis: What patch format is best for you to incooperate into your release?
This one is a unified diff against unpatched source.
Regards,
Max
-- Binary/unsupported file stripped by Ecartis --
-- Type: application/octet-stream
-- File: if_tun.c.diff
More information about the freebsd-pf
mailing list