tcpdump mailing list archives

[PATCH] print-sflow.c - actually print more than one extended counter sample


From: Rick Jones <rick.jones2 () hp com>
Date: Fri, 01 Apr 2011 18:03:00 -0700

tcpdump 4.1.1, and 4.3.0-PRE-GIT_2011_04_01 prints just one expanded
counter sample per captured PDU because it mistakenly skips forward
sflow_sample_len when it has already adjusted tprt and tlen while it was
printing the sample contents. This then leaves it confused about what it
is seeing. Shifting the adjustment to the "default sample" case where
the sample wasn't printed appears to fix this, though there is still
some question as to whether it should advance by sflow_sample_len or
some adjustment thereof.

Signed-off-by: Rick Jones <rick.jones2 () hp com>

raj@tardy:~/tcpdump$ diff print-sflow.c.orig print-sflow.c
559a560,565
          /* since we didn't know about it, we haven't advanced
             through it and need to move-on to the next one. what
             isn't clear is if we should adjust by the full
             sflow_sample_len or not */
          tptr += sflow_sample_len;
          tlen -= sflow_sample_len;
562,563c568,571
<         tptr += sflow_sample_len;
<         tlen -= sflow_sample_len;
---
      /* if we are here, it means we successfully decoded our way
         through the sample, and we do not* want to actually skip
         forward by sflow_sample_len like we used to, because we've
         already advanced through the counters. */


rick jones

-
This is the tcpdump-workers list.
Visit https://cod.sandelman.ca/ to unsubscribe.


Current thread: