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
This commit is contained in:
Martin Mathieson 2013-04-23 02:55:44 +00:00
parent 048b751c21
commit f78d7ed4d7
1 changed files with 6 additions and 0 deletions

View File

@ -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);