diff options
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/packet-mpls.c | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/epan/dissectors/packet-mpls.c b/epan/dissectors/packet-mpls.c index 54dc835de5..59e9a206a2 100644 --- a/epan/dissectors/packet-mpls.c +++ b/epan/dissectors/packet-mpls.c @@ -312,12 +312,24 @@ dissect_try_cw_first_nibble( tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree switch ( nibble ) { case 6: + /* + * XXX - this could be from an pseudo-wire without a control + * word, with the packet's first nibble being 6. + */ call_dissector(dissector_ipv6, tvb, pinfo, tree); return TRUE; case 4: + /* + * XXX - this could be from an pseudo-wire without a control + * word, with the packet's first nibble being 4. + */ call_dissector(dissector_ip, tvb, pinfo, tree); return TRUE; case 1: + /* + * XXX - this could be from an pseudo-wire without a control + * word, with the packet's first nibble being 1. + */ call_dissector(dissector_pw_ach, tvb, pinfo, tree ); return TRUE; default: @@ -454,30 +466,57 @@ dissect_mpls(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ next_tvb = tvb_new_subset_remaining(tvb, offset); - /* 1) explicit label-to-dissector binding ? */ + /* + * Is there an explicit label-to-dissector binding? + * If so, use it. + */ found = dissector_try_uint_new(mpls_subdissector_table, label, next_tvb, pinfo, tree, FALSE, &mplsinfo); - if (found) + if (found) { + /* Yes, there is. */ return tvb_captured_length(tvb); + } - /* 2) use the 1st nibble logic (see BCP 4928, RFC 4385 and 5586) */ + /* + * No, there isn't, so use the 1st nibble logic (see BCP 4928, + * RFC 4385 and 5586). + */ switch(first_nibble) { case 4: + /* + * XXX - this could be from an Ethernet pseudo-wire without a + * control word, with the MAC address's first nibble being 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)); break; case 6: + /* + * XXX - this could be from an Ethernet pseudo-wire without a + * control word, with the MAC address's first nibble being 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)); break; case 1: + /* + * XXX - this could be from an Ethernet pseudo-wire without a + * control word, with the MAC address's first nibble being 1. + */ call_dissector(dissector_pw_ach, next_tvb, pinfo, tree); break; case 0: + /* + * If this is an Ethernet pseudo-wire, this could either be + * Ethernet without a control word and with the first nibble + * of the destination MAC address being 0 or it could be + * Ethernet with a control word. Let the "pw_eth_heuristic" + * dissector try to figure it out. + */ call_dissector(dissector_pw_eth_heuristic, next_tvb, pinfo, tree); break; default: |