]> The Tcpdump Group git mirrors - tcpdump/commitdiff
GRE: Replace the ND_TTEST_*() calls with ND_TCHECK_*() calls
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 23 Feb 2019 17:05:36 +0000 (18:05 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 23 Feb 2019 17:05:36 +0000 (18:05 +0100)
print-gre.c

index 0b9e4423e47f73bd099d13293168f3ae546a023b..f363f8b1cfcb1a54497a495debb277b1c83bbf85 100644 (file)
@@ -364,8 +364,7 @@ gre_sre_ip_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen,
        }
 
        while (srelen != 0) {
        }
 
        while (srelen != 0) {
-               if (!ND_TTEST_4(bp))
-                       return (0);
+               ND_TCHECK_4(bp);
                if (len < 4)
                        return (0);
 
                if (len < 4)
                        return (0);
 
@@ -378,6 +377,8 @@ gre_sre_ip_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen,
                srelen -= 4;
        }
        return (1);
                srelen -= 4;
        }
        return (1);
+trunc:
+       return 0;
 }
 
 static int
 }
 
 static int
@@ -400,8 +401,7 @@ gre_sre_asn_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen,
        }
 
        while (srelen != 0) {
        }
 
        while (srelen != 0) {
-               if (!ND_TTEST_2(bp))
-                       return (0);
+               ND_TCHECK_2(bp);
                if (len < 2)
                        return (0);
 
                if (len < 2)
                        return (0);
 
@@ -413,4 +413,6 @@ gre_sre_asn_print(netdissect_options *ndo, uint8_t sreoff, uint8_t srelen,
                srelen -= 2;
        }
        return (1);
                srelen -= 2;
        }
        return (1);
+trunc:
+       return 0;
 }
 }