X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/f3d3a1bc8f40f22ba68bdb34a073e3852d79b573..54d17b22b10fe8c1a1cadb8c14c1900c1be33ef8:/print-esp.c diff --git a/print-esp.c b/print-esp.c index 80dd7218..ade654a3 100644 --- a/print-esp.c +++ b/print-esp.c @@ -600,7 +600,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) { struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)&sa->daddr; - if (sa->spi == ntohl(esp->esp_spi) && + if (sa->spi == EXTRACT_32BITS(&esp->esp_spi) && sin6->sin6_family == AF_INET6 && memcmp(&sin6->sin6_addr, &ip6->ip6_dst, sizeof(struct in6_addr)) == 0) { @@ -618,7 +618,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) { struct sockaddr_in *sin = (struct sockaddr_in *)&sa->daddr; - if (sa->spi == ntohl(esp->esp_spi) && + if (sa->spi == EXTRACT_32BITS(&esp->esp_spi) && sin->sin_family == AF_INET && sin->sin_addr.s_addr == ip->ip_dst.s_addr) { break;