aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-dvb-s2-bb.c
diff options
context:
space:
mode:
authorMustBeArt <paul@mustbeart.com>2017-01-01 08:47:40 -0800
committerMartin Kaiser <wireshark@kaiser.cx>2017-01-07 12:05:16 +0000
commitfb9ac503c16e88408a53e808f17f19f63787f2de (patch)
tree749f5459e2a039f2e8dd5e26ca85ed1fc6ba72b7 /epan/dissectors/packet-dvb-s2-bb.c
parent0dcbfab4265b4f494a7b162d2c34c99ed7994541 (diff)
DVB-S2 BB: Fix BB header CRC checks
Fix problem with baseband header CRC check that caused almost all baseband frames to show a spurious CRC error, introduced with proto_tree_add_checksum. Change-Id: I6b2f9680507eeb79e59b825f3ac9e4cee1033976 Reviewed-on: https://code.wireshark.org/review/19567 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan/dissectors/packet-dvb-s2-bb.c')
-rw-r--r--epan/dissectors/packet-dvb-s2-bb.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/epan/dissectors/packet-dvb-s2-bb.c b/epan/dissectors/packet-dvb-s2-bb.c
index fda51b1f56..04d1abb28b 100644
--- a/epan/dissectors/packet-dvb-s2-bb.c
+++ b/epan/dissectors/packet-dvb-s2-bb.c
@@ -546,7 +546,7 @@ static const range_string gse_proto_str[] = {
#define DVB_S2_GSE_CRC32_LEN 4
/* *** helper functions *** */
-static gboolean check_crc8(tvbuff_t *p, guint8 len, guint8 offset, guint8 received_fcs)
+static guint8 compute_crc8(tvbuff_t *p, guint8 len, guint8 offset)
{
int i;
guint8 crc = 0, tmp;
@@ -555,10 +555,7 @@ static gboolean check_crc8(tvbuff_t *p, guint8 len, guint8 offset, guint8 receiv
tmp = tvb_get_guint8(p, offset++);
crc = crc8_table[crc ^ tmp];
}
- if (received_fcs == crc)
- return TRUE;
- else
- return FALSE;
+ return crc;
}
/* *** Code to actually dissect the packets *** */
@@ -709,7 +706,7 @@ static gboolean test_dvb_s2_crc(tvbuff_t *tvb, guint offset) {
input8 = tvb_get_guint8(tvb, offset + DVB_S2_BB_OFFS_CRC);
- if (!check_crc8(tvb, DVB_S2_BB_HEADER_LEN - 1, offset, input8))
+ if (compute_crc8(tvb, DVB_S2_BB_HEADER_LEN - 1, offset) != input8)
return FALSE;
else
return TRUE;
@@ -787,11 +784,9 @@ static int dissect_dvb_s2_bb(tvbuff_t *tvb, int cur_off, proto_tree *tree, packe
new_off += 2;
proto_tree_add_item(dvb_s2_bb_tree, hf_dvb_s2_bb_syncd, tvb, cur_off + DVB_S2_BB_OFFS_SYNCD, 2, ENC_BIG_ENDIAN);
- input8 = tvb_get_guint8(tvb, cur_off + DVB_S2_BB_OFFS_CRC);
new_off += 1;
-
proto_tree_add_checksum(dvb_s2_bb_tree, tvb, cur_off + DVB_S2_BB_OFFS_CRC, hf_dvb_s2_bb_crc, hf_dvb_s2_bb_crc_status, &ei_dvb_s2_bb_crc, pinfo,
- check_crc8(tvb, DVB_S2_BB_HEADER_LEN - 1, cur_off, input8), ENC_NA, PROTO_CHECKSUM_VERIFY);
+ compute_crc8(tvb, DVB_S2_BB_HEADER_LEN - 1, cur_off), ENC_NA, PROTO_CHECKSUM_VERIFY);
while (bb_data_len) {
/* start DVB-GSE dissector */