From: Brian Morris (bmorris2) Date: Fri, 27 Aug 2021 17:39:33 +0000 (+0000) Subject: Merge pull request #3033 in SNORT/snort3 from ~RAMANKS/snort3:nat66 to master X-Git-Tag: 3.1.12.0~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d5d698ca2748c02324d1e076a3aea13f8f628adf;p=thirdparty%2Fsnort3.git Merge pull request #3033 in SNORT/snort3 from ~RAMANKS/snort3:nat66 to master Squashed commit of the following: commit 83111633eb3dc9fae737690f3a26380e0e3c73d6 Author: Raman Krishnan Date: Thu Aug 19 14:18:00 2021 -0700 decoder: icmp6: use source and destination addresses from packet to compute icmp6 checksum when NAT is in effect --- diff --git a/src/codecs/ip/cd_icmp6.cc b/src/codecs/ip/cd_icmp6.cc index 14e704f6d..86f0b2f89 100644 --- a/src/codecs/ip/cd_icmp6.cc +++ b/src/codecs/ip/cd_icmp6.cc @@ -152,8 +152,9 @@ bool Icmp6Codec::decode(const RawData& raw, CodecData& codec, DecodeData& snort) if ( snort::get_network_policy()->icmp_checksums() && !valid_checksum_from_daq(raw)) { checksum::Pseudoheader6 ph6; - COPY4(ph6.hdr.sip, snort.ip_api.get_src()->get_ip6_ptr()); - COPY4(ph6.hdr.dip, snort.ip_api.get_dst()->get_ip6_ptr()); + const ip::IP6Hdr* const ip6h = snort.ip_api.get_ip6h(); + COPY4(ph6.hdr.sip, ip6h->get_src()->u6_addr32); + COPY4(ph6.hdr.dip, ip6h->get_dst()->u6_addr32); ph6.hdr.zero = 0; ph6.hdr.protocol = codec.ip6_csum_proto; ph6.hdr.len = htons((uint16_t)raw.len);