]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bgp.c
BGP: Fix a test invalid on a 32 bits system
[tcpdump] / print-bgp.c
index 33c482e6fdc3b698178d5aad6e72971ad92199b4..04f0c3fa561e54a43a1138dc8531f89291bdd957 100644 (file)
@@ -1726,7 +1726,7 @@ bgp_attr_print(netdissect_options *ndo,
                        ND_PRINT((ndo, ", no SNPA"));
                 }
 
-               while (len - (tptr - pptr) > 0) {
+               while (tptr < pptr + len) {
                     switch (af<<8 | safi) {
                     case (AFNUM_INET<<8 | SAFNUM_UNICAST):
                     case (AFNUM_INET<<8 | SAFNUM_MULTICAST):
@@ -1894,7 +1894,7 @@ bgp_attr_print(netdissect_options *ndo,
 
                tptr += 3;
 
-               while (len - (tptr - pptr) > 0) {
+               while (tptr < pptr + len) {
                     switch (af<<8 | safi) {
                     case (AFNUM_INET<<8 | SAFNUM_UNICAST):
                     case (AFNUM_INET<<8 | SAFNUM_MULTICAST):