]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-lmp.c
CI: Add warning exemptions for Sun C (suncc-5.14) on Solaris 10
[tcpdump] / print-lmp.c
index bcd69e7b242eafd989c056c54641d7bd9d75a75c..bfb0798e578797e8ea14435a304478b17d364764 100644 (file)
@@ -20,9 +20,7 @@
 /* specification: RFC 4204 */
 /* OIF UNI 1.0: https://web.archive.org/web/20160401194747/http://www.oiforum.com/public/documents/OIF-UNI-01.0.pdf */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -362,7 +360,6 @@ lmp_print_data_link_subobjs(netdissect_options *ndo, const u_char *obj_tptr,
 {
     int hexdump = FALSE;
     int subobj_type, subobj_len;
-    float bw;
 
     while (total_subobj_len > 0 && hexdump == FALSE ) {
        subobj_type = GET_U_1(obj_tptr + offset);
@@ -397,12 +394,10 @@ lmp_print_data_link_subobjs(netdissect_options *ndo, const u_char *obj_tptr,
                        "Unknown",
                        GET_U_1(obj_tptr + offset + 3)),
                GET_U_1(obj_tptr + offset + 3));
-           bw = GET_BE_F_4(obj_tptr + offset + 4);
            ND_PRINT("\n\t      Min Reservable Bandwidth: %.3f Mbps",
-                bw*8/1000000);
-           bw = GET_BE_F_4(obj_tptr + offset + 8);
+               GET_BE_F_4(obj_tptr + offset + 4)*8/1000000);
            ND_PRINT("\n\t      Max Reservable Bandwidth: %.3f Mbps",
-                bw*8/1000000);
+               GET_BE_F_4(obj_tptr + offset + 8)*8/1000000);
            break;
        case WAVELENGTH_SUBOBJ:
            ND_PRINT("\n\t      Wavelength: %u",
@@ -429,7 +424,6 @@ lmp_print(netdissect_options *ndo,
     int hexdump;
     u_int offset;
     u_int link_type;
-    float bw;
 
     ndo->ndo_protocol = "lmp";
     tptr=pptr;
@@ -477,7 +471,7 @@ lmp_print(netdissect_options *ndo,
     tptr+=sizeof(struct lmp_common_header);
     tlen-=sizeof(struct lmp_common_header);
 
-    while(tlen>0) {
+    while(tlen != 0) {
         const struct lmp_object_header *lmp_obj_header =
             (const struct lmp_object_header *)tptr;
         lmp_obj_len=GET_BE_U_2(lmp_obj_header->length);
@@ -795,8 +789,8 @@ lmp_print(netdissect_options *ndo,
                        GET_BE_U_2(obj_tptr + 10),
                        GET_BE_U_2(obj_tptr + 10),
                        GET_BE_U_2(obj_tptr + 10)&8000 ? " (Payload test messages capable)" : "");
-                bw = GET_BE_F_4(obj_tptr + 12);
-               ND_PRINT("\n\t    Transmission Rate: %.3f Mbps",bw*8/1000000);
+               ND_PRINT("\n\t    Transmission Rate: %.3f Mbps",
+                       GET_BE_F_4(obj_tptr + 12)*8/1000000);
                ND_PRINT("\n\t    Wavelength: %u",
                        GET_BE_U_4(obj_tptr + 16));
                break;