mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-20 17:11:45 +00:00
net: implement Udp_packet::checksum_error
For checking the checksum of a UDP packet. Issue #2775
This commit is contained in:
parent
6b55790e73
commit
841d583678
@ -79,6 +79,9 @@ class Net::Udp_packet
|
||||
void update_checksum(Ipv4_address ip_src,
|
||||
Ipv4_address ip_dst);
|
||||
|
||||
bool checksum_error(Ipv4_address ip_src,
|
||||
Ipv4_address ip_dst) const;
|
||||
|
||||
|
||||
/***************
|
||||
** Accessors **
|
||||
|
@ -39,3 +39,11 @@ void Net::Udp_packet::update_checksum(Ipv4_address ip_src,
|
||||
_checksum = internet_checksum_pseudo_ip((uint16_t*)this, length(), _length,
|
||||
Ipv4_packet::Protocol::UDP, ip_src, ip_dst);
|
||||
}
|
||||
|
||||
|
||||
bool Net::Udp_packet::checksum_error(Ipv4_address ip_src,
|
||||
Ipv4_address ip_dst) const
|
||||
{
|
||||
return internet_checksum_pseudo_ip((uint16_t*)this, length(), _length,
|
||||
Ipv4_packet::Protocol::UDP, ip_src, ip_dst);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user