]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fixes-for-test-results
authorAjith Adapa <[email protected]>
Thu, 7 Feb 2013 05:37:29 +0000 (11:07 +0530)
committerAjith Adapa <[email protected]>
Thu, 7 Feb 2013 05:37:29 +0000 (11:07 +0530)
print-isoclns.c
print-stp.c
tests/spb_bpduv4.out

index b8b181384145316a8105ffacee835ad39777beb0..4f8a5bb7d13a7d747d6a8bcae5973d2eef566f04 100644 (file)
@@ -1328,8 +1328,7 @@ isis_print_mcid (const struct isis_spb_mcid *mcid)
 static int
 isis_print_mt_port_cap_subtlv (const u_int8_t *tptr, int len)
 {
-  int stlv_type;
-  int stlv_len;
+  int stlv_type, stlv_len;
   const struct isis_subtlv_spb_mcid *subtlv_spb_mcid;
   int i;
 
@@ -1344,79 +1343,87 @@ isis_print_mt_port_cap_subtlv (const u_int8_t *tptr, int len)
                stlv_type,
                stlv_len);
 
+    /*len -= TLV_TYPE_LEN_OFFSET;*/
     len = len -2;
 
     switch (stlv_type)
     {
       case ISIS_SUBTLV_SPB_MCID:
+      {
+        if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_MCID_MIN_LEN))
+          goto trunctlv;
 
-          if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_MCID_MIN_LEN))
-            goto trunctlv;
+        subtlv_spb_mcid = (struct isis_subtlv_spb_mcid *)tptr;
 
-          subtlv_spb_mcid = (struct isis_subtlv_spb_mcid *)tptr;
+        printf( "\n\t         MCID: ");
+        isis_print_mcid (&(subtlv_spb_mcid->mcid));
 
-          printf( "\n\t         MCID: ");
-          isis_print_mcid (&(subtlv_spb_mcid->mcid));
+          /*tptr += SPB_MCID_MIN_LEN;
+            len -= SPB_MCID_MIN_LEN; */
 
-          printf( "\n\t         AUX-MCID: ");
-          isis_print_mcid (&(subtlv_spb_mcid->aux_mcid));
+        printf( "\n\t         AUX-MCID: ");
+        isis_print_mcid (&(subtlv_spb_mcid->aux_mcid));
 
-          tptr = tptr + sizeof(struct isis_subtlv_spb_mcid);
-          len = len - sizeof(struct isis_subtlv_spb_mcid);
+          /*tptr += SPB_MCID_MIN_LEN;
+            len -= SPB_MCID_MIN_LEN; */
+        tptr = tptr + sizeof(struct isis_subtlv_spb_mcid);
+        len = len - sizeof(struct isis_subtlv_spb_mcid);
 
-          break;
+        break;
+      }
 
       case ISIS_SUBTLV_SPB_DIGEST:
+      {
+        if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_DIGEST_MIN_LEN))
+          goto trunctlv;
 
-          if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_DIGEST_MIN_LEN))
-            goto trunctlv;
-
-          printf ("\n\t         RES: %d V: %d A: %d D: %d",
+        printf ("\n\t        RES: %d V: %d A: %d D: %d",
                         (*(tptr) >> 5), (((*tptr)>> 4) & 0x01),
                         ((*(tptr) >> 2) & 0x03), ((*tptr) & 0x03));
 
-          tptr++;
+        tptr++;
 
-          printf( "\n\t         Digest: ");
+        printf( "\n\t         Digest: ");
           
-          for(i=1;i<=8; i++)
-          {
+        for(i=1;i<=8; i++)
+        {
             printf("%08x ", EXTRACT_32BITS(tptr));
             if (i%4 == 0 && i != 8)
               printf("\n\t                 ");
             tptr = tptr + 4;
-          }
+        }
 
-          len = len - ISIS_SUBTLV_SPB_DIGEST_MIN_LEN;
+        len = len - ISIS_SUBTLV_SPB_DIGEST_MIN_LEN;
 
-          break;
+        break;
+      }
 
       case ISIS_SUBTLV_SPB_BVID:
+      {
+        if (!TTEST2(*(tptr), stlv_len))
+          goto trunctlv;
 
-          if (!TTEST2(*(tptr), stlv_len))
+        while (len)
+        {
+          if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_BVID_MIN_LEN))
             goto trunctlv;
 
-          while (len)
-          {
-            if (!TTEST2(*(tptr), ISIS_SUBTLV_SPB_BVID_MIN_LEN))
-              goto trunctlv;
-
-            printf("\n\t           ECT: %08x", 
+          printf("\n\t           ECT: %08x", 
                       EXTRACT_32BITS(tptr));
 
-            tptr = tptr+4;
+          tptr = tptr+4;
 
-            printf(" B-Vlan: %d, U:%01x, M:%01x RES: %01x",
+          printf(" BVID: %d, U:%01x M:%01x ",
                      (EXTRACT_16BITS (tptr) >> 4) ,
                      (EXTRACT_16BITS (tptr) >> 3) & 0x01,
-                     (EXTRACT_16BITS (tptr) >> 2) & 0x01,
-                     (EXTRACT_16BITS (tptr) & 0x03));
+                     (EXTRACT_16BITS (tptr) >> 2) & 0x01);
 
-            tptr = tptr + 2;
-            len = len - ISIS_SUBTLV_SPB_BVID_MIN_LEN;
-          }
+          tptr = tptr + 2;
+          len = len - ISIS_SUBTLV_SPB_BVID_MIN_LEN;
+        }
 
-          break;
+        break;
+      }
       
       default:
           break;
@@ -1430,7 +1437,6 @@ isis_print_mt_port_cap_subtlv (const u_int8_t *tptr, int len)
     return(1); 
 }
 
-
 static int
 isis_print_mt_capability_subtlv (const u_int8_t *tptr, int len)
 {
@@ -2754,7 +2760,7 @@ static int isis_print (const u_int8_t *p, u_int length)
            break;
 
     case ISIS_TLV_MT_PORT_CAP:
-
+    {
       if (!TTEST2(*(tptr), 2))
         goto trunctlv;
 
@@ -2767,7 +2773,9 @@ static int isis_print (const u_int8_t *p, u_int length)
 
       if (tmp)
         isis_print_mt_port_cap_subtlv (tptr, tmp);
+
       break;
+    }
 
     case ISIS_TLV_MT_CAPABILITY:
 
index c88f6de9e4640842bd42ecae6a38fdce5313faa7..7880268acee5b77abcdaae63a5533fb21c8df532 100644 (file)
@@ -409,10 +409,12 @@ stp_print(const u_char *p, u_int length)
             if (length < STP_BPDU_MSTP_MIN_LEN) {
                 goto trunc;
             }
+
             if (stp_bpdu->v1_length != 0) {
                 /* FIX ME: Emit a message here ? */
                 goto trunc;
             }
+
             /* Validate v3 length */
             mstp_len = EXTRACT_16BITS(p + MST_BPDU_VER3_LEN_OFFSET);
             mstp_len += 2;  /* length encoding itself is 2 bytes */
@@ -422,6 +424,7 @@ stp_print(const u_char *p, u_int length)
 
             if (stp_bpdu->protocol_version == STP_PROTO_SPB)
             {
+              /* Validate v4 length */
               spb_len = EXTRACT_16BITS (p + MST_BPDU_VER3_LEN_OFFSET + mstp_len);
               spb_len += 2;
               if (length < (sizeof(struct stp_bpdu_) + mstp_len + spb_len) ||
index adc519f2cbcc2ef86bdbd0a3ea30880d43540b26..748d4d25d1af652f33e638e270b6940c78d28c75 100644 (file)
@@ -1,25 +1,25 @@
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
-STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward]
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205
+STP 802.1aq, Rapid STP, CIST Flags [Learn, Forward], length 205