diff options
author | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2012-08-30 15:23:54 +0000 |
---|---|---|
committer | Chris Maynard <Christopher.Maynard@GTECH.COM> | 2012-08-30 15:23:54 +0000 |
commit | 733baac21e5447d997a38b38e79c7846ce20c486 (patch) | |
tree | bc81a5f984e0f7d633fde231b36bdb4b41c02388 | |
parent | 0e79405e0dbe40b0b667a2166bcea3c8e4ca9bc7 (diff) |
Fix Session ID parsing. Patch from Fransesco Fondelli via bug 6881.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6881
svn path=/trunk/; revision=44701
-rw-r--r-- | epan/dissectors/packet-mpls-pm.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/epan/dissectors/packet-mpls-pm.c b/epan/dissectors/packet-mpls-pm.c index 027b65d7d9..af72f962ce 100644 --- a/epan/dissectors/packet-mpls-pm.c +++ b/epan/dissectors/packet-mpls-pm.c @@ -447,29 +447,22 @@ mpls_pm_build_cinfo(tvbuff_t *tvb, packet_info *pinfo, const char *str_pmt, gboolean *class_specific, guint32 *sid, guint8 *code) { - int offset = 0; - guint32 sid3, sid2, sid1, sid0; - col_add_fstr(pinfo->cinfo, COL_PROTOCOL, "MPLS PM (%s)", str_pmt); col_clear(pinfo->cinfo, COL_INFO); - *response = (tvb_get_guint8(tvb, offset) & 0x08) ? TRUE : FALSE; - *class_specific = (tvb_get_guint8(tvb, offset) & 0x04) ? TRUE : FALSE; + *response = (tvb_get_guint8(tvb, 0) & 0x08) ? TRUE : FALSE; + *class_specific = (tvb_get_guint8(tvb, 0) & 0x04) ? TRUE : FALSE; *query = !(*response); - *code = tvb_get_guint8(tvb, offset + 1); + *code = tvb_get_guint8(tvb, 1); if (!(*class_specific)) { /* * FF: when the T flag is set to 0 the DS field can be considered * part of the Session Identifier. */ - *sid = tvb_get_ntohl(tvb, offset + 8); + *sid = tvb_get_ntohl(tvb, 8); } else { - sid3 = tvb_get_guint8(tvb, offset + 8); - sid2 = tvb_get_guint8(tvb, offset + 9); - sid1 = tvb_get_guint8(tvb, offset + 10); - sid0 = tvb_get_guint8(tvb, offset + 11) & 0xC0; - *sid = (sid0 >> 6) | (sid1 << 8) | (sid2 << 16) | (sid3 << 24); + *sid = tvb_get_ntohl(tvb, 8) >> 6; } if (*query) { |