tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

patch for duplicate tcp acks



Howdy,

        I was suffering duplicate tpc acks.  It seems trivial to duplicate.... Any time I receive a non-zero len tcp packet, I ack it twice.  Note that I'm using a window scale of 3 and that may or may come into play.

        Anyway, did some debugging and some comparing. I found a patch for this problem in freebsd.
https://svnweb.freebsd.org/base/head/sys/netinet/tcp_output.c?r1=216758&r2=220794


Here is how I applied it to netbsd (diff included below). It works for me. But I'm on an embedded system with a funky compiler and modified source.  I'm giving this patch to the list in hopes that someone will feel like compiling / testing it in a truer netbsd kernel.




Index: src/sys/netinet/tcp_output.c
===================================================================
RCS file: /cvsroot/src/sys/netinet/tcp_output.c,v
retrieving revision 1.173
diff -r1.173 tcp_output.c
1023,1024c1023,1038
<               long adv = min(win, (long)TCP_MAXWIN << tp->rcv_scale) -
<                       (tp->rcv_adv - tp->rcv_nxt);
---
>               long adv;
>               int oldwin;
>
>               adv = fp_min(win, (long)FP_TCP_MAXWIN << tp->rcv_scale);
>               if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt)) {
>                               oldwin = (tp->rcv_adv - tp->rcv_nxt);
>                               adv -= oldwin;
>               } else
>                               oldwin = 0;
>
>               /*
>                * If the new window size ends up being the same as the old
>                * size when it is scaled, then don't force a window update.
>                */
>               if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale)
>                               goto dontupdate;
1030a1045
>       dontupdate:



--
Ricky Charlet
Software Dev / Routing Dude: Aries team, Roseville CA
ricky.charlet%hp.com@localhost<mailto:ricky.charlet%hp.com@localhost>
USA: 916.785.2090





Home | Main Index | Thread Index | Old Index