summaryrefslogtreecommitdiff
path: root/wiretap/commview.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-10-12 20:51:04 +0000
committerGuy Harris <guy@alum.mit.edu>2012-10-12 20:51:04 +0000
commit10b89e0430d1fbeb142fe816b49b9a691e4364c1 (patch)
tree4249276f5e719028d67e3d2014de34d87f4418e3 /wiretap/commview.c
parent58c859dd900a7c995a5bb492899720308e2790fe (diff)
downloadwireshark-10b89e0430d1fbeb142fe816b49b9a691e4364c1.tar.gz
The "rate" field in the CommView NCF format is 1 byte long, not 2 bytes
long; that means we read only one byte into our structure, so make its "rate" element one byte long, so we don't fill in half the "rate" element with the read - and the *wrong* half on big-endian machines - and leave the other half un-set and thus containing some random possibly non-zero data. In addition, that's not the full data rate for faster networks; for Wi-Fi, the one-byte "direction" field is actually the upper 8 bits of the data rate, so combine them when we fill in the data rate in the pseudo-header. #BACKPORT svn path=/trunk/; revision=45504
Diffstat (limited to 'wiretap/commview.c')
-rw-r--r--wiretap/commview.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/wiretap/commview.c b/wiretap/commview.c
index fb97f3d2eb..ca187ac79e 100644
--- a/wiretap/commview.c
+++ b/wiretap/commview.c
@@ -57,7 +57,7 @@ typedef struct commview_header {
guint32 usecs;
guint8 flags; /* Bit-field positions defined below */
guint8 signal_level_percent;
- guint16 rate;
+ guint8 rate;
guint8 band;
guint8 channel;
guint8 direction; /* Or for WiFi, high order byte of
@@ -143,7 +143,8 @@ commview_set_pseudo_header(commview_header_t *cv_hdrp, union wtap_pseudo_header
pseudo_header->ieee_802_11.fcs_len = -1; /* Unknown */
pseudo_header->ieee_802_11.decrypted = FALSE;
pseudo_header->ieee_802_11.channel = cv_hdrp->channel;
- pseudo_header->ieee_802_11.data_rate = cv_hdrp->rate;
+ pseudo_header->ieee_802_11.data_rate =
+ cv_hdrp->rate | (cv_hdrp->direction << 8);
pseudo_header->ieee_802_11.signal_level = cv_hdrp->signal_level_percent;
break;