patch for BGP/VPLS dissector

Hannes Gredler <[email protected]> Sat, 01 Jul 2006 08:10:08 +0200
Newsgroups gmane.network.ethereal.devel
Message-ID <[email protected]>
hi ethereal developers,

attached a patch for the BGP dissetor for correct display of
VPLS NLRIs as per the latest spec (draft-ietf-l2vpn-vpls-bgp-08).

in rev 18189 the label-block size was missing.

/hannes


Index: epan/dissectors/packet-bgp.c
===================================================================
--- epan/dissectors/packet-bgp.c        (revision 18189)
+++ epan/dissectors/packet-bgp.c        (working copy)
@@ -652,7 +652,7 @@
      guint               plen;               /* length of the prefix address, in bits */
      guint               labnum;             /* number of labels             */
      guint16            tnl_id;             /* Tunnel Identifier */
-    int                 ce_id,labblk_off;
+    int                 ce_id,labblk_off,labblk_size;
      union {
         guint8 addr_bytes[4];
         guint32 addr;
@@ -1022,7 +1022,8 @@
              rd_type=tvb_get_ntohs(tvb,offset+2);
              ce_id=tvb_get_ntohs(tvb,offset+10);
              labblk_off=tvb_get_ntohs(tvb,offset+12);
-            labnum = decode_MPLS_stack(tvb, offset + 14, lab_stk, sizeof(lab_stk));
+            labblk_size=tvb_get_ntohs(tvb,offset+14);
+            labnum = decode_MPLS_stack(tvb, offset + 16, lab_stk, sizeof(lab_stk));

              switch (rd_type) {

@@ -1030,10 +1031,12 @@
                  tvb_memcpy(tvb, ip4addr.addr_bytes, offset + 6, 4);
                  proto_tree_add_text(tree, tvb, start_offset,
                          (offset + plen + 1) - start_offset,
-                        "RD: %u:%s, CE-ID: %u, Label-Block Offset: %u, Label Base %s",
+                        "RD: %u:%s, CE-ID: %u, Label Block Offset: %u, "
+                        "Label Block Size: %u Label Base %s",
                          tvb_get_ntohs(tvb, offset + 4),
                          ip_to_str(ip4addr.addr_bytes),
                          ce_id,
+                        labblk_size,
                          labblk_off,
                          lab_stk);
                  break;
@@ -1042,11 +1045,13 @@
                  tvb_memcpy(tvb, ip4addr.addr_bytes, offset + 4, 4);
                  proto_tree_add_text(tree, tvb, offset,
                          (offset + plen + 1) - start_offset,
-                        "RD: %s:%u, CE-ID: %u, Label-Block Offset: %u, Label Base %s",
+                        "RD: %s:%u, CE-ID: %u, Label Block Offset: %u, "
+                        "Label Block Size: %u, Label Base %s",
                          ip_to_str(ip4addr.addr_bytes),
                          tvb_get_ntohs(tvb, offset + 8),
                          ce_id,
                          labblk_off,
+                        labblk_size,
                          lab_stk);
                  break;