Date: Wed, 27 Aug 2008 13:00:19 GMT From: Rui Paulo <rpaulo@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 148605 for review Message-ID: <200808271300.m7RD0JNK083725@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=148605 Change 148605 by rpaulo@rpaulo_phi on 2008/08/27 12:59:21 Expand snd_scale and rcv_scale as per RFC 1323. Add more debugging information. Affected files ... .. //depot/projects/soc2008/rpaulo-tcpad/dumper.c#14 edit .. //depot/projects/soc2008/rpaulo-tcpad/verify.c#18 edit Differences ... ==== //depot/projects/soc2008/rpaulo-tcpad/dumper.c#14 (text+ko) ==== @@ -23,7 +23,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/soc2008/rpaulo-tcpad/dumper.c#13 $ + * $P4: //depot/projects/soc2008/rpaulo-tcpad/dumper.c#14 $ */ #include <assert.h> @@ -62,6 +62,8 @@ head = cp->pktshead; assert(head != NULL); + DPRINTF(DEBUG_DUMP, "%s: %p %p\n", __func__, cp, head); + dp = malloc(sizeof(*dp)); if (dp == NULL) { fprintf(stderr, "%s: malloc failed\n", __func__); @@ -88,7 +90,12 @@ va_list ap; assert(cp != NULL); - assert(cp->pktshead != NULL); + /* + * XXX: might happen. explain why + */ + if (cp->pktshead == NULL) + return; + //assert(cp->pktshead != NULL); for (i = 0; i < 3000; i++) { snprintf(path, sizeof(path), "%s/dump%03d.txt", DUMPER_PATH, i); @@ -189,4 +196,5 @@ } free(head); cp->pktshead = NULL; + DPRINTF(DEBUG_DUMP, "freeing done\n"); } ==== //depot/projects/soc2008/rpaulo-tcpad/verify.c#18 (text+ko) ==== @@ -23,7 +23,7 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - * $P4: //depot/projects/soc2008/rpaulo-tcpad/verify.c#17 $ + * $P4: //depot/projects/soc2008/rpaulo-tcpad/verify.c#18 $ */ #include <stdio.h> @@ -304,7 +304,7 @@ return (cp); } tp->irs = th->th_seq; - tp->rcv_wnd = th->th_win; + tp->rcv_wnd = th->th_win >> tp->rcv_scale; } /* @@ -334,8 +334,8 @@ return (NULL); } break; - default: - dumper_error(cp, "RST with no known state"); + //default: + //dumper_error(cp, "RST with no known state"); } } /* @@ -473,7 +473,7 @@ if (SEQ_LT(tp->snd_wl1, th->th_seq) || (tp->snd_wl1 == th->th_seq && SEQ_LEQ(tp->snd_wl2, th->th_ack))) { - tp->snd_wnd = th->th_win; + tp->snd_wnd = th->th_win << tp->snd_scale; tp->snd_wl1 = th->th_seq; tp->snd_wl2 = th->th_ack; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808271300.m7RD0JNK083725>