mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 07:38:28 +00:00
udp: rename method calc_checksum update_checksum
In other contexts (IPv4) 'calc_checksum' merely returns a new checksum that is then installed via 'checksum'. Thus, the UDP 'calc_checksum' that calculates AND installs a new checksum is misleading. Ref #114
This commit is contained in:
committed by
Christian Helmuth
parent
ee9c4679df
commit
0ce79f3a8a
@ -110,8 +110,8 @@ class Net::Udp_packet
|
|||||||
* | 4 bytes | 4 bytes | 1 byte | 1 byte | 2 bytes |
|
* | 4 bytes | 4 bytes | 1 byte | 1 byte | 2 bytes |
|
||||||
* --------------------------------------------------------------
|
* --------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
void calc_checksum(Ipv4_address src,
|
void update_checksum(Ipv4_address src,
|
||||||
Ipv4_address dst)
|
Ipv4_address dst)
|
||||||
{
|
{
|
||||||
/* have to reset the checksum field for calculation */
|
/* have to reset the checksum field for calculation */
|
||||||
_checksum = 0;
|
_checksum = 0;
|
||||||
|
@ -63,7 +63,7 @@ bool Session_component::handle_ip(Ethernet_frame *eth, Genode::size_t size)
|
|||||||
Dhcp_packet(size - sizeof(Ipv4_packet) - sizeof(Udp_packet));
|
Dhcp_packet(size - sizeof(Ipv4_packet) - sizeof(Udp_packet));
|
||||||
if (dhcp->op() == Dhcp_packet::REQUEST) {
|
if (dhcp->op() == Dhcp_packet::REQUEST) {
|
||||||
dhcp->broadcast(true);
|
dhcp->broadcast(true);
|
||||||
udp->calc_checksum(ip->src(), ip->dst());
|
udp->update_checksum(ip->src(), ip->dst());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user