diff --git a/RELEASE_NOTES b/RELEASE_NOTES index f96aed0ad..74f1ea9bf 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -77,6 +77,7 @@ Bugs fixed - Bug 2242 - Mobility of both sender PHY and receiver PHY set to sender mobility in lr-wpan-phy-test.cc example. - Bug 2243 - TCP Socket Fork() fails to copy some parameters, causing connections to close prematurely on retransmit - Bug 2246 - Some DSR LogComponents and classes are not defined in a unique way. +- Bug 2254 - Ipv[4,6]RawSocket can return the wrong number of bytes sent. Known issues ------------ diff --git a/src/internet/model/ipv4-raw-socket-impl.cc b/src/internet/model/ipv4-raw-socket-impl.cc index 0eca83c70..ec098741c 100644 --- a/src/internet/model/ipv4-raw-socket-impl.cc +++ b/src/internet/model/ipv4-raw-socket-impl.cc @@ -237,6 +237,7 @@ Ipv4RawSocketImpl::SendTo (Ptr p, uint32_t flags, if (route != 0) { NS_LOG_LOGIC ("Route exists"); + uint32_t pktSize = p->GetSize (); if (!m_iphdrincl) { ipv4->Send (p, route->GetSource (), dst, m_protocol, route); @@ -245,9 +246,9 @@ Ipv4RawSocketImpl::SendTo (Ptr p, uint32_t flags, { ipv4->SendWithHeader (p, header, route); } - NotifyDataSent (p->GetSize ()); + NotifyDataSent (pktSize); NotifySend (GetTxAvailable ()); - return p->GetSize (); + return pktSize; } else { diff --git a/src/internet/model/ipv6-raw-socket-impl.cc b/src/internet/model/ipv6-raw-socket-impl.cc index 3446a81ba..159aebae1 100644 --- a/src/internet/model/ipv6-raw-socket-impl.cc +++ b/src/internet/model/ipv6-raw-socket-impl.cc @@ -245,6 +245,7 @@ int Ipv6RawSocketImpl::SendTo (Ptr p, uint32_t flags, const Address& toA } } + uint32_t pktSize = p->GetSize (); if (m_src.IsAny ()) { ipv6->Send (p, route->GetSource (), dst, m_protocol, route); @@ -254,7 +255,7 @@ int Ipv6RawSocketImpl::SendTo (Ptr p, uint32_t flags, const Address& toA ipv6->Send (p, m_src, dst, m_protocol, route); } // Return only payload size (as Linux does). - return p->GetSize () - hdr.GetSerializedSize (); + return pktSize - hdr.GetSerializedSize (); } else {