]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #3033 in SNORT/snort3 from ~RAMANKS/snort3:nat66 to master
authorBrian Morris (bmorris2) <bmorris2@cisco.com>
Fri, 27 Aug 2021 17:39:33 +0000 (17:39 +0000)
committerBrian Morris (bmorris2) <bmorris2@cisco.com>
Fri, 27 Aug 2021 17:39:33 +0000 (17:39 +0000)
Squashed commit of the following:

commit 83111633eb3dc9fae737690f3a26380e0e3c73d6
Author: Raman Krishnan <ramanks@cisco.com>
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

src/codecs/ip/cd_icmp6.cc

index 14e704f6d04287e6c383fd12ab7759bb2b5b54d4..86f0b2f892f4fb3205f7e6434fc2e71db0d7a14e 100644 (file)
@@ -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);