Instead of throwing in 48 and 64 as numbers, use vwr->STATS_LEN to
indicate what the lengths are. Yeah, it has to be fetched at run time,
but big deal.
That also shows that, as we've already rejected records whose size is
less than vwr->STATS_LEN, we don't have to check for that, so eliminate
those checks.
Change-Id: Id4822b3e5a02abfffb2da96a50999e36548a4279
Reviewed-on: https://code.wireshark.org/review/663
Reviewed-by: Guy Harris <guy@alum.mit.edu>
float phyRate;
- if (rec_size<64)
- rec_size = 64;
-
/* Calculate the start of the statistics block in the buffer */
/* Also get a bunch of fields from the stats block */
- s_ptr = &(rec[rec_size - 64]); /* point to it */
+ s_ptr = &(rec[rec_size - vwr->STATS_LEN]); /* point to it */
m_type = s_ptr[1] & 0x7;
f_tx = !(s_ptr[1] & 0x8);
octets = pntoh16(&s_ptr[8]);
guint64 delta_b; /* Used for calculating latency */
- if (rec_size<48)
- rec_size = 48;
-
/* Calculate the start of the statistics block in the buffer */
/* Also get a bunch of fields from the stats block */
s_start_ptr = &(rec[0]);
- s_trail_ptr = &(rec[rec_size - 48]); /* point to it */
+ s_trail_ptr = &(rec[rec_size - vwr->STATS_LEN]); /* point to it */
/* L1p info is different for series III and for Series II - need to check */
l1p_1 = s_start_ptr[0];