(bug 746) UDP source address is not set to bound address
authorFabian Mauchle <fabian.mauchle@hsr.ch>
Thu, 19 Nov 2009 16:12:05 +0100
changeset 5769 f6f3e7bae1a4
parent 5768 a07d60db8448
child 5770 bb1eea10412f
(bug 746) UDP source address is not set to bound address
src/internet-stack/udp-socket-impl.cc
--- a/src/internet-stack/udp-socket-impl.cc	Mon Nov 23 13:52:51 2009 +0100
+++ b/src/internet-stack/udp-socket-impl.cc	Thu Nov 19 16:12:05 2009 +0100
@@ -401,6 +401,11 @@
       NS_LOG_LOGIC ("Limited broadcast end.");
       return p->GetSize();
     }
+  else if (m_endPoint->GetLocalAddress() != Ipv4Address::GetAny())
+    {
+      m_udp->Send(p->Copy (), m_endPoint->GetLocalAddress(), dest,
+                  m_endPoint->GetLocalPort(), port, 0);
+    }
   else if (ipv4->GetRoutingProtocol () != 0)
     {
       Ipv4Header header;