diff options
author | Guy Harris <guy@alum.mit.edu> | 2017-04-29 19:42:18 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2017-04-30 02:43:04 +0000 |
commit | 5c1cf9d46ad80f1ce5367724fa28bb55a44dee39 (patch) | |
tree | f4cf17b3bc0575d54e83d5fa120f47bc3fbb9be6 /wiretap | |
parent | bc7452d1d91a6e3f1544037f60c3511c42e7e03a (diff) |
Series III packets appear to have an FCS at the end.
Change-Id: I9c4ba78cba4cb32a1473c6b8573880f2b56f1fde
Reviewed-on: https://code.wireshark.org/review/21417
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/vwr.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/wiretap/vwr.c b/wiretap/vwr.c index c0b407cca1..fee2b82833 100644 --- a/wiretap/vwr.c +++ b/wiretap/vwr.c @@ -1979,34 +1979,35 @@ static gboolean vwr_read_s3_W_rec(vwr_t *vwr, struct wtap_pkthdr *phdr, phyRate = (guint16)(getRate(plcp_type, mcs_index, radioflags, nss) * 10); /* Calculation of Data rate ends*/ - /* - * The MSDU length includes the FCS. - * - * The packet data does *not* include the FCS - it's just 4 bytes - * of junk - so we have to remove it. - * - * We'll be stripping off an FCS (?), so make sure we have at - * least 4 octets worth of FCS. - */ - if (actual_octets < 4) { - *err_info = g_strdup_printf("vwr: Invalid data length %u (too short to include 4 bytes of FCS)", - actual_octets); - *err = WTAP_ERR_BAD_FILE; - return FALSE; - } /* 'ver_fpga' is the 2nd Octet of each frame. * msb/lsb nibble indicates log mode/fpga version respectively. * where log mode = 0 is normal capture and 1 is reduced capture, * lsb nibble is set to 1 always as this function is applicable for only FPGA version >= 48 */ if (log_mode == 3) { + /* + * The MSDU length includes the FCS. + * + * The packet data does *not* include the FCS - it's just 4 bytes + * of junk - so we have to remove it. + * + * We'll be stripping off an FCS (?), so make sure we have at + * least 4 octets worth of FCS. + * + * XXX - is the FCS actually present here, as it appears to be + * if log_mode isn't 3? + */ + if (actual_octets < 4) { + *err_info = g_strdup_printf("vwr: Invalid data length %u (too short to include 4 bytes of FCS)", + actual_octets); + *err = WTAP_ERR_BAD_FILE; + return FALSE; + } if (actual_octets > 4 && (frame_size >= (int) msdu_length)) actual_octets -=4; ver_fpga = 0x11; } else { - if (actual_octets > 4) - actual_octets -= 4; ver_fpga = 0x01; } |