Index: src/internet/model/udp-header.cc |
=================================================================== |
--- a/src/internet/model/udp-header.cc |
+++ b/src/internet/model/udp-header.cc |
@@ -132,6 +132,12 @@ |
return ~(it.CalculateIpChecksum (hdrSize)); |
} |
+uint16_t |
+UdpHeader::CalculateHeaderChecksum(uint32_t size) const |
+{ |
+ return CalculateHeaderChecksum(static_cast<uint16_t> (size)); |
+} |
+ |
bool |
UdpHeader::IsChecksumOk (void) const |
{ |
@@ -189,7 +195,7 @@ |
i.WriteHtonU16 (m_destinationPort); |
if (m_payloadSize == 0) |
{ |
- i.WriteHtonU16 (start.GetSize ()); |
+ i.WriteHtonU16 (static_cast<uint16_t> (start.GetSize ())); |
} |
else |
{ |
@@ -222,7 +228,7 @@ |
Buffer::Iterator i = start; |
m_sourcePort = i.ReadNtohU16 (); |
m_destinationPort = i.ReadNtohU16 (); |
- m_payloadSize = i.ReadNtohU16 () - GetSerializedSize (); |
+ m_payloadSize = i.ReadNtohU16 () - static_cast<uint16_t> (GetSerializedSize ()); |
m_checksum = i.ReadU16 (); |
if (m_calcChecksum) |