From 61375f8ef58bb2c326e50dcd591d11c0ce21e9b1 Mon Sep 17 00:00:00 2001 From: Liu Jian Date: Tue, 15 Apr 2008 09:41:58 -0700 Subject: [PATCH] Fix bug 168: Socket::SendTo does not return the number of bytes sent for udp sockets. --- src/internet-node/udp-socket.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/internet-node/udp-socket.cc b/src/internet-node/udp-socket.cc index 383870c34..935a05f67 100644 --- a/src/internet-node/udp-socket.cc +++ b/src/internet-node/udp-socket.cc @@ -300,6 +300,7 @@ UdpSocket::DoSendTo (Ptr p, Ipv4Address dest, uint16_t port) NotifyDataSent (p->GetSize ()); } NS_LOG_LOGIC ("Limited broadcast end."); + return p->GetSize(); } else if (ipv4->GetIfIndexForDestination(dest, localIfIndex)) { @@ -307,7 +308,7 @@ UdpSocket::DoSendTo (Ptr p, Ipv4Address dest, uint16_t port) m_udp->Send (p, ipv4->GetAddress (localIfIndex), dest, m_endPoint->GetLocalPort (), port); NotifyDataSent (p->GetSize ()); - return 0; + return p->GetSize();; } else {