aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mpls.c
diff options
context:
space:
mode:
authorMartin Mathieson <martin.r.mathieson@googlemail.com>2013-04-23 02:55:44 +0000
committerMartin Mathieson <martin.r.mathieson@googlemail.com>2013-04-23 02:55:44 +0000
commitf78d7ed4d706f660e080bd941c1eecc300245d83 (patch)
tree56df5129ef4725da276d1884887b76d9fe60f274 /epan/dissectors/packet-mpls.c
parent048b751c214f17f1cd16b9c7e2d5987cbe029ef8 (diff)
When calling IP and Ipv6 dissectors, they may reduce the new tvb we pass in.
MPLS needs to similarly shrink its own tvb so its caller can tell that there were bytes left over (e.g. ethernet trailer). svn path=/trunk/; revision=48994
Diffstat (limited to 'epan/dissectors/packet-mpls.c')
-rw-r--r--epan/dissectors/packet-mpls.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c
index 0b5ca2416c..b8ca05bddc 100644
--- a/epan/dissectors/packet-mpls.c
+++ b/epan/dissectors/packet-mpls.c
@@ -608,9 +608,15 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* 2) use the 1st nibble logic (see BCP 4928, RFC 4385 and 5586) */
if (first_nibble == 4) {
call_dissector(dissector_ip, next_tvb, pinfo, tree);
+ /* IP dissector may reduce the length of the tvb.
+ We need to do the same, so that ethernet trailer is detected. */
+ set_actual_length(tvb, offset+tvb_reported_length(next_tvb));
return;
} else if (first_nibble == 6) {
call_dissector(dissector_ipv6, next_tvb, pinfo, tree);
+ /* IPv6 dissector may reduce the length of the tvb.
+ We need to do the same, so that ethernet trailer is detected. */
+ set_actual_length(tvb, offset+tvb_reported_length(next_tvb));
return;
} else if (first_nibble == 1) {
dissect_pw_ach(next_tvb, pinfo, tree);