]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-isoclns.c
Add changes in 4.2.1.
[tcpdump] / print-isoclns.c
index 7e2bba70a4024af63c92a97c60a218c934c7d8b0..57637055377b2c6c9c60f67e1b0ff076d08fee8e 100644 (file)
@@ -618,10 +618,6 @@ struct isis_tlv_lsp {
 
 void isoclns_print(const u_int8_t *p, u_int length, u_int caplen)
 {
-       const struct isis_common_header *header;
-
-       header = (const struct isis_common_header *)p;
-
         if (caplen <= 1) { /* enough bytes on the wire ? */
             printf("|OSI");
             return;
@@ -1179,15 +1175,15 @@ esis_print(const u_int8_t *pptr, u_int length)
        }
 
         /* now walk the options */
-        while (li >= 2) {
+        while (li != 0) {
             u_int op, opli;
             const u_int8_t *tptr;
             
-            TCHECK2(*pptr, 2);
             if (li < 2) {
                 printf(", bad opts/li");
                 return;
             }
+            TCHECK2(*pptr, 2);
             op = *pptr++;
             opli = *pptr++;
             li -= 2;
@@ -1206,8 +1202,11 @@ esis_print(const u_int8_t *pptr, u_int length)
             switch (op) {
 
             case ESIS_OPTION_ES_CONF_TIME:
-                TCHECK2(*pptr, 2);
-                printf("%us", EXTRACT_16BITS(tptr));
+                if (opli == 2) {
+                    TCHECK2(*pptr, 2);
+                    printf("%us", EXTRACT_16BITS(tptr));
+                } else
+                    printf("(bad length)");
                 break;
 
             case ESIS_OPTION_PROTOCOLS: