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:
Martin Stein 2016-08-15 14:42:29 +02:00 committed by Christian Helmuth
parent ee9c4679df
commit 0ce79f3a8a
2 changed files with 3 additions and 3 deletions

View File

@ -110,8 +110,8 @@ class Net::Udp_packet
* | 4 bytes | 4 bytes | 1 byte | 1 byte | 2 bytes |
* --------------------------------------------------------------
*/
void calc_checksum(Ipv4_address src,
Ipv4_address dst)
void update_checksum(Ipv4_address src,
Ipv4_address dst)
{
/* have to reset the checksum field for calculation */
_checksum = 0;

View File

@ -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));
if (dhcp->op() == Dhcp_packet::REQUEST) {
dhcp->broadcast(true);
udp->calc_checksum(ip->src(), ip->dst());
udp->update_checksum(ip->src(), ip->dst());
}
}
}