--- ns-3-dev/src/internet/model/udp-socket-impl.cc 2012-01-26 15:52:06.000000000 -0200 +++ workspace/src/ns-3-dev/src/internet/model/udp-socket-impl.cc 2012-01-26 16:15:16.000000000 -0200 @@ -31,6 +31,7 @@ #include "udp-socket-impl.h" #include "udp-l4-protocol.h" #include "ipv4-end-point.h" +#include "udp-header.h" #include NS_LOG_COMPONENT_DEFINE ("UdpSocketImpl"); @@ -440,6 +441,13 @@ Ptr route; Ptr oif = m_boundnetdevice; //specify non-zero if bound to a specific device // TBD-- we could cache the route and just check its validity + + // Patch - BUG 1111 - UDP header does not attached before RouteOutput + UdpHeader headerUdp; + headerUdp.SetSourcePort(m_endPoint->GetLocalPort ()); + headerUdp.SetDestinationPort(port); + p->AddHeader(headerUdp); + route = ipv4->GetRoutingProtocol ()->RouteOutput (p, header, oif, errno_); if (route != 0) {