summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorNathan Binkert <binkertn@umich.edu>2004-11-15 15:40:35 -0500
committerNathan Binkert <binkertn@umich.edu>2004-11-15 15:40:35 -0500
commitf7323aebe846d1e46ad95dec5d17917538136949 (patch)
tree7c2368c68fe1a9d63d734142b015bdb30be19e41 /base
parentc250a16e05b9176e8a2b50faa7a5a09f978ecd7e (diff)
downloadgem5-f7323aebe846d1e46ad95dec5d17917538136949.tar.xz
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
Diffstat (limited to 'base')
-rw-r--r--base/inet.hh4
1 files 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; }