Ethereal-dev: Re: [Ethereal-dev] [Patch] packet-tcp.c

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <gharris@xxxxxxxxx>
Date: Thu, 22 Dec 2005 21:17:57 -0800
Bill Meier wrote:

   if (check_col(pinfo->cinfo, COL_INFO)) {
-    col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] Seq=%u Ack=%u Win=%u",
-      flags, tcph->th_seq, tcph->th_ack, tcph->th_win);
+    col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] Seq=%u",
+      flags, tcph->th_seq);
+    if (tcph->th_flags & TH_ACK) {
+      col_append_fstr(pinfo->cinfo, COL_INFO, " Ack=%u Win=%u",
+        tcph->th_ack, tcph->th_win);
+    }
   }

Should the window setting be displayed even if ACK isn't set? Obviously the ack shouldn't be - to quote RFC 793:

  Acknowledgment Number:  32 bits

    If the ACK control bit is set this field contains the value of the
    next sequence number the sender of the segment is expecting to
    receive.  Once a connection is established this is always sent.

(and if ACK isn't set, the field's contents are meaningless), but 793 doesn't say anything about the window value being valid only if ACK is set.