]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-isoclns.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-isoclns.c
index 4732ec0bc5c39bc33ea648df29be0a7ad40381e6..89598b2d2d3182dc21af085ef5ac68c49744d4af 100644 (file)
@@ -34,9 +34,7 @@
  * IS-IS: ISO 10589
  */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -1015,7 +1013,7 @@ clnp_print(netdissect_options *ndo,
                     }
                     tptr+=nsap_offset;
                     tlen-=nsap_offset;
-                    while (tlen > 0) {
+                    while (tlen != 0) {
                             source_address_length=GET_U_1(tptr);
                             if (tlen < source_address_length+1) {
                                     ND_PRINT("\n\t    NSAP address goes past end of option");
@@ -1327,7 +1325,7 @@ esis_print(netdissect_options *ndo,
 
             ND_PRINT("\n\t  Number of Source Addresses: %u", source_address_number);
 
-            while (source_address_number > 0) {
+            while (source_address_number != 0) {
                 ND_TCHECK_1(pptr);
                if (li < 1) {
                     ND_PRINT(", bad esh/li");
@@ -1420,7 +1418,7 @@ esis_print(netdissect_options *ndo,
                 break;
 
             case ESIS_OPTION_PROTOCOLS:
-                while (opli>0) {
+                while (opli != 0) {
                     ND_PRINT("%s (0x%02x)",
                            tok2str(nlpid_values,
                                    "unknown",
@@ -1804,7 +1802,7 @@ isis_print_tlv_ip_reach(netdissect_options *ndo,
 
        tlv_ip_reach = (const struct isis_tlv_ip_reach *)cp;
 
-       while (length > 0) {
+       while (length != 0) {
                if ((size_t)length < sizeof(*tlv_ip_reach)) {
                        ND_PRINT("short IPv4 Reachability (%u vs %zu)",
                                length,
@@ -1950,7 +1948,6 @@ isis_print_ext_is_reach(netdissect_options *ndo,
     u_int subtlv_type,subtlv_len,subtlv_sum_len;
     int proc_bytes = 0; /* how many bytes did we process ? */
     u_int te_class,priority_level,gmpls_switch_cap;
-    float bw;
 
     ND_TCHECK_LEN(tptr, NODE_ID_LEN);
     if (tlv_remaining < NODE_ID_LEN)
@@ -2037,19 +2034,16 @@ isis_print_ext_is_reach(netdissect_options *ndo,
                 break;
             case ISIS_SUBTLV_EXT_IS_REACH_MAX_LINK_BW :
             case ISIS_SUBTLV_EXT_IS_REACH_RESERVABLE_BW:
-                if (subtlv_len >= 4) {
-                    bw = GET_BE_F_4(tptr);
-                    ND_PRINT(", %.3f Mbps", bw * 8 / 1000000);
-                }
+                if (subtlv_len >= 4)
+                    ND_PRINT(", %.3f Mbps", GET_BE_F_4(tptr) * 8 / 1000000);
                 break;
             case ISIS_SUBTLV_EXT_IS_REACH_UNRESERVED_BW :
                 if (subtlv_len >= 32) {
                     for (te_class = 0; te_class < 8; te_class++) {
-                        bw = GET_BE_F_4(tptr);
                         ND_PRINT("%s  TE-Class %u: %.3f Mbps",
                                   indent,
                                   te_class,
-                                  bw * 8 / 1000000);
+                                  GET_BE_F_4(tptr) * 8 / 1000000);
                         tptr += 4;
                         subtlv_len -= 4;
                         subtlv_sum_len -= 4;
@@ -2073,11 +2067,10 @@ isis_print_ext_is_reach(netdissect_options *ndo,
                 for (te_class = 0; subtlv_len != 0; te_class++) {
                     if (subtlv_len < 4)
                         break;
-                    bw = GET_BE_F_4(tptr);
                     ND_PRINT("%s  Bandwidth constraint CT%u: %.3f Mbps",
                               indent,
                               te_class,
-                              bw * 8 / 1000000);
+                              GET_BE_F_4(tptr) * 8 / 1000000);
                     tptr += 4;
                     subtlv_len -= 4;
                     subtlv_sum_len -= 4;
@@ -2133,11 +2126,10 @@ isis_print_ext_is_reach(netdissect_options *ndo,
                     proc_bytes += 4;
                     ND_PRINT("%s  Max LSP Bandwidth:", indent);
                     for (priority_level = 0; priority_level < 8; priority_level++) {
-                        bw = GET_BE_F_4(tptr);
                         ND_PRINT("%s    priority level %u: %.3f Mbps",
                                   indent,
                                   priority_level,
-                                  bw * 8 / 1000000);
+                                  GET_BE_F_4(tptr) * 8 / 1000000);
                         tptr += 4;
                         subtlv_len -= 4;
                         subtlv_sum_len -= 4;
@@ -2150,16 +2142,17 @@ isis_print_ext_is_reach(netdissect_options *ndo,
                     case GMPLS_PSC4:
                         if (subtlv_len < 6)
                             break;
-                        bw = GET_BE_F_4(tptr);
-                        ND_PRINT("%s  Min LSP Bandwidth: %.3f Mbps", indent, bw * 8 / 1000000);
+                        ND_PRINT("%s  Min LSP Bandwidth: %.3f Mbps",
+                                 indent,
+                                 GET_BE_F_4(tptr) * 8 / 1000000);
                         ND_PRINT("%s  Interface MTU: %u", indent,
                                  GET_BE_U_2(tptr + 4));
                         break;
                     case GMPLS_TSC:
                         if (subtlv_len < 8)
                             break;
-                        bw = GET_BE_F_4(tptr);
-                        ND_PRINT("%s  Min LSP Bandwidth: %.3f Mbps", indent, bw * 8 / 1000000);
+                        ND_PRINT("%s  Min LSP Bandwidth: %.3f Mbps", indent,
+                                  GET_BE_F_4(tptr) * 8 / 1000000);
                         ND_PRINT("%s  Indication %s", indent,
                                   tok2str(gmpls_switch_cap_tsc_indication_values, "Unknown (%u)", GET_U_1((tptr + 4))));
                         break;
@@ -2338,7 +2331,7 @@ isis_print_extd_ip_reach(netdissect_options *ndo,
         processed+=sublen+1;
         ND_PRINT(" (%u)", sublen);   /* print out subTLV length */
 
-        while (sublen>0) {
+        while (sublen != 0) {
             subtlvtype=GET_U_1(tptr);
             subtlvlen=GET_U_1(tptr + 1);
             tptr+=2;
@@ -2846,7 +2839,7 @@ isis_print(netdissect_options *ndo,
      * Now print the TLV's.
      */
 
-    while (packet_len > 0) {
+    while (packet_len != 0) {
        ND_TCHECK_2(pptr);
        if (packet_len < 2)
            goto trunc;