From f7323aebe846d1e46ad95dec5d17917538136949 Mon Sep 17 00:00:00 2001 From: Nathan Binkert Date: Mon, 15 Nov 2004 15:40:35 -0500 Subject: [PATCH] fix udp checksums base/inet.hh: tcp/udp/ip checksums are calculated/manipulated in NBO always, so there's no need to convert to host endian. --HG-- extra : convert_revision : 13d6aff025a6c072d9d829c2e9fad4f13399b1f7 --- base/inet.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/inet.hh b/base/inet.hh index 10b782a6c..4f3857a15 100644 --- a/base/inet.hh +++ b/base/inet.hh @@ -348,9 +348,9 @@ struct UdpHdr : public udp_hdr uint16_t sport() const { return ntohs(uh_sport); } uint16_t dport() const { return ntohs(uh_dport); } uint16_t len() const { return ntohs(uh_ulen); } - uint16_t sum() const { return ntohs(uh_sum); } + uint16_t sum() const { return uh_sum; } - void sum(uint16_t sum) { uh_sum = htons(sum); } + void sum(uint16_t sum) { uh_sum = sum; } int size() const { return sizeof(udp_hdr); } const uint8_t *bytes() const { return (const uint8_t *)this; } -- 2.30.2