]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Use nd_ types.
authorGuy Harris <[email protected]>
Sat, 30 Dec 2017 23:08:40 +0000 (15:08 -0800)
committerGuy Harris <[email protected]>
Sat, 30 Dec 2017 23:08:40 +0000 (15:08 -0800)
print-esp.c

index 646320abc3a641c237a0d3216e7f134638968663..4de04c4af76ecd9f250e6471311f7a5c845bd613 100644 (file)
@@ -87,8 +87,8 @@
  */
 
 struct newesp {
-       uint32_t        esp_spi;        /* ESP */
-       uint32_t        esp_seq;        /* Sequence number */
+       nd_uint32_t     esp_spi;        /* ESP */
+       nd_uint32_t     esp_seq;        /* Sequence number */
        /*variable size*/               /* (IV and) Payload data */
        /*variable size*/               /* padding */
        /*8bit*/                        /* pad size */
@@ -684,8 +684,8 @@ esp_print(netdissect_options *ndo,
                ND_PRINT((ndo, "[|ESP]"));
                goto fail;
        }
-       ND_PRINT((ndo, "ESP(spi=0x%08x", EXTRACT_BE_U_4(&esp->esp_spi)));
-       ND_PRINT((ndo, ",seq=0x%x)", EXTRACT_BE_U_4(&esp->esp_seq)));
+       ND_PRINT((ndo, "ESP(spi=0x%08x", EXTRACT_BE_U_4(esp->esp_spi)));
+       ND_PRINT((ndo, ",seq=0x%x)", EXTRACT_BE_U_4(esp->esp_seq)));
        ND_PRINT((ndo, ", length %u", length));
 
 #ifndef HAVE_LIBCRYPTO
@@ -707,14 +707,14 @@ esp_print(netdissect_options *ndo,
        case 6:
                ip6 = (const struct ip6_hdr *)bp2;
                /* we do not attempt to decrypt jumbograms */
-               if (!EXTRACT_BE_U_2(&ip6->ip6_plen))
+               if (!EXTRACT_BE_U_2(ip6->ip6_plen))
                        goto fail;
                /* if we can't get nexthdr, we do not need to decrypt it */
-               len = sizeof(struct ip6_hdr) + EXTRACT_BE_U_2(&ip6->ip6_plen);
+               len = sizeof(struct ip6_hdr) + EXTRACT_BE_U_2(ip6->ip6_plen);
 
                /* see if we can find the SA, and if so, decode it */
                for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) {
-                       if (sa->spi == EXTRACT_BE_U_4(&esp->esp_spi) &&
+                       if (sa->spi == EXTRACT_BE_U_4(esp->esp_spi) &&
                            sa->daddr_version == 6 &&
                            UNALIGNED_MEMCMP(&sa->daddr.in6, &ip6->ip6_dst,
                                   sizeof(struct in6_addr)) == 0) {
@@ -730,7 +730,7 @@ esp_print(netdissect_options *ndo,
 
                /* see if we can find the SA, and if so, decode it */
                for (sa = ndo->ndo_sa_list_head; sa != NULL; sa = sa->next) {
-                       if (sa->spi == EXTRACT_BE_U_4(&esp->esp_spi) &&
+                       if (sa->spi == EXTRACT_BE_U_4(esp->esp_spi) &&
                            sa->daddr_version == 4 &&
                            UNALIGNED_MEMCMP(&sa->daddr.in4, &ip->ip_dst,
                                   sizeof(struct in_addr)) == 0) {