]> The Tcpdump Group git mirrors - tcpdump/commitdiff
(for 4.9.3) ICMP: fix a compiler warning
authorDenis Ovsienko <[email protected]>
Tue, 17 Oct 2017 22:24:36 +0000 (23:24 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sun, 18 Aug 2019 18:35:51 +0000 (20:35 +0200)
"ISO C90 forbids mixed declarations and code"

print-icmp.c

index c5005fb58df150cf212778bf37e628bc2427fb78..170d5438f20fdc88103ef88a32d59baef0331af0 100644 (file)
@@ -564,8 +564,9 @@ icmp_print(netdissect_options *ndo, const u_char *bp, u_int plen, const u_char *
                        vec[0].len = plen;
                        sum = in_cksum(vec, 1);
                        if (sum != 0) {
+                               uint16_t icmp_sum;
                                ND_TCHECK_16BITS(&dp->icmp_cksum);
-                               uint16_t icmp_sum = EXTRACT_16BITS(&dp->icmp_cksum);
+                               icmp_sum = EXTRACT_16BITS(&dp->icmp_cksum);
                                ND_PRINT((ndo, " (wrong icmp cksum %x (->%x)!)",
                                             icmp_sum,
                                             in_cksum_shouldbe(icmp_sum, sum)));