mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Change ICMPv6 checksum calculation to use IP_Hdr wrapper.
So that src/dst addresses used in pseudo-header are correct when there's certain extension headers (routing/destination). Add ICMP/ICMPv6 checksum unit tests.
This commit is contained in:
parent
958c6c7cf4
commit
27ba3118c1
12 changed files with 19 additions and 7 deletions
|
@ -65,18 +65,17 @@ inline int seq_delta(uint32 a, uint32 b)
|
|||
}
|
||||
|
||||
class IPAddr;
|
||||
class IP_Hdr;
|
||||
|
||||
// Returns the ones-complement checksum of a chunk of b short-aligned bytes.
|
||||
extern int ones_complement_checksum(const void* p, int b, uint32 sum);
|
||||
|
||||
extern int ones_complement_checksum(const IPAddr& a, uint32 sum);
|
||||
|
||||
extern int icmp6_checksum(const struct icmp* icmpp, const struct ip6_hdr* ip6,
|
||||
int len);
|
||||
extern int icmp6_checksum(const struct icmp* icmpp, const IP_Hdr* ip, int len);
|
||||
extern int icmp_checksum(const struct icmp* icmpp, int len);
|
||||
|
||||
#ifdef ENABLE_MOBILE_IPV6
|
||||
class IP_Hdr;
|
||||
extern int mobility_header_checksum(const IP_Hdr* ip);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue