]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bgp.c
CI: Add warning exemptions for Sun C (suncc-5.15) on Solaris 10
[tcpdump] / print-bgp.c
index 8f319f85dca8a1b3dd18a1de870f29d1800dece2..bb302545d34494cc0c014935e1d537d17cb04abf 100644 (file)
@@ -34,9 +34,7 @@
 
 /* specification: RFC 4271 */
 
-#ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif
 
 #include "netdissect-stdinc.h"
 
@@ -893,7 +891,6 @@ static void
 bgp_extended_community_print(netdissect_options *ndo,
                              const u_char *pptr)
 {
-    float bw;
     /* allocate space for the largest possible string */
     char astostr[AS_STR_SIZE];
 
@@ -925,9 +922,8 @@ bgp_extended_community_print(netdissect_options *ndo,
             break;
 
     case BGP_EXT_COM_LINKBAND:
-            bw = GET_BE_F_4(pptr + 4);
             ND_PRINT("bandwidth: %.3f Mbps",
-                     bw*8/1000000);
+                     GET_BE_F_4(pptr + 4)*8/1000000);
             break;
 
     case BGP_EXT_COM_OVS:
@@ -1328,26 +1324,6 @@ trunc:
     return -2;
 }
 
-/*
- * As I remember, some versions of systems have an snprintf() that
- * returns -1 if the buffer would have overflowed.  If the return
- * value is negative, set buflen to 0, to indicate that we've filled
- * the buffer up.
- *
- * If the return value is greater than buflen, that means that
- * the buffer would have overflowed; again, set buflen to 0 in
- * that case.
- */
-#define UPDATE_BUF_BUFLEN(buf, buflen, stringlen) \
-    if (stringlen<0) \
-        buflen=0; \
-    else if ((u_int)stringlen>buflen) \
-        buflen=0; \
-    else { \
-        buflen-=stringlen; \
-        buf+=stringlen; \
-    }
-
 static int
 print_labeled_vpn_l2(netdissect_options *ndo, const u_char *pptr)
 {