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
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);