From 0ce79f3a8a891f1a50ef8d39fdd90415f2a3f95b Mon Sep 17 00:00:00 2001 From: Martin Stein Date: Mon, 15 Aug 2016 14:42:29 +0200 Subject: [PATCH] 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 --- repos/os/include/net/udp.h | 4 ++-- repos/os/src/server/nic_bridge/component.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/repos/os/include/net/udp.h b/repos/os/include/net/udp.h index 6646925ce..239a4128e 100644 --- a/repos/os/include/net/udp.h +++ b/repos/os/include/net/udp.h @@ -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; diff --git a/repos/os/src/server/nic_bridge/component.cc b/repos/os/src/server/nic_bridge/component.cc index a6ced95a3..015d914bd 100644 --- a/repos/os/src/server/nic_bridge/component.cc +++ b/repos/os/src/server/nic_bridge/component.cc @@ -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()); } } }