diff --git a/src/internet/model/icmpv4-l4-protocol.cc b/src/internet/model/icmpv4-l4-protocol.cc index deee55424..0ea2b6955 100644 --- a/src/internet/model/icmpv4-l4-protocol.cc +++ b/src/internet/model/icmpv4-l4-protocol.cc @@ -57,7 +57,7 @@ Icmpv4L4Protocol::NotifyNewAggregate () if (node != 0) { Ptr ipv4 = this->GetObject (); - if (ipv4 != 0) + if (ipv4 != 0 && m_downTarget.IsNull ()) { this->SetNode (node); ipv4->Insert (this); diff --git a/src/internet/model/icmpv6-l4-protocol.cc b/src/internet/model/icmpv6-l4-protocol.cc index 14454f28f..fca45f34e 100644 --- a/src/internet/model/icmpv6-l4-protocol.cc +++ b/src/internet/model/icmpv6-l4-protocol.cc @@ -112,7 +112,7 @@ void Icmpv6L4Protocol::NotifyNewAggregate () if (node != 0) { Ptr ipv6 = this->GetObject (); - if (ipv6 != 0) + if (ipv6 != 0 && m_downTarget.IsNull ()) { SetNode (node); ipv6->Insert (this); diff --git a/src/internet/model/nsc-tcp-l4-protocol.cc b/src/internet/model/nsc-tcp-l4-protocol.cc index f14f8ef3d..d8ccfa94e 100644 --- a/src/internet/model/nsc-tcp-l4-protocol.cc +++ b/src/internet/model/nsc-tcp-l4-protocol.cc @@ -196,7 +196,7 @@ NscTcpL4Protocol::NotifyNewAggregate () if (node != 0) { Ptr ipv4 = this->GetObject (); - if (ipv4 != 0) + if (ipv4 != 0 && m_downTarget.IsNull ()) { this->SetNode (node); ipv4->Insert (this); diff --git a/src/internet/model/tcp-l4-protocol.cc b/src/internet/model/tcp-l4-protocol.cc index 00d865f6e..ba861e55f 100644 --- a/src/internet/model/tcp-l4-protocol.cc +++ b/src/internet/model/tcp-l4-protocol.cc @@ -132,12 +132,12 @@ TcpL4Protocol::NotifyNewAggregate () // need to keep track of whether we are connected to an IPv4 or // IPv6 lower layer and call the appropriate one. - if (ipv4 != 0) + if (ipv4 != 0 && m_downTarget.IsNull ()) { ipv4->Insert(this); this->SetDownTarget(MakeCallback(&Ipv4::Send, ipv4)); } - if (ipv6 != 0) + if (ipv6 != 0 && m_downTarget6.IsNull ()) { ipv6->Insert(this); this->SetDownTarget6(MakeCallback(&Ipv6L3Protocol::Send, ipv6)); diff --git a/src/internet/model/udp-l4-protocol.cc b/src/internet/model/udp-l4-protocol.cc index dedda074a..83034e44b 100644 --- a/src/internet/model/udp-l4-protocol.cc +++ b/src/internet/model/udp-l4-protocol.cc @@ -88,6 +88,7 @@ UdpL4Protocol::SetNode (Ptr node) void UdpL4Protocol::NotifyNewAggregate () { + NS_LOG_FUNCTION (this); Ptr node = this->GetObject (); Ptr ipv4 = this->GetObject (); Ptr ipv6 = node->GetObject (); @@ -108,12 +109,12 @@ UdpL4Protocol::NotifyNewAggregate () // need to keep track of whether we are connected to an IPv4 or // IPv6 lower layer and call the appropriate one. - if (ipv4 != 0) + if (ipv4 != 0 && m_downTarget.IsNull()) { ipv4->Insert (this); this->SetDownTarget (MakeCallback (&Ipv4::Send, ipv4)); } - if (ipv6 != 0) + if (ipv6 != 0 && m_downTarget6.IsNull()) { ipv6->Insert (this); this->SetDownTarget6 (MakeCallback (&Ipv6L3Protocol::Send, ipv6)); @@ -499,6 +500,7 @@ UdpL4Protocol::Send (Ptr packet, void UdpL4Protocol::SetDownTarget (IpL4Protocol::DownTargetCallback callback) { + NS_LOG_FUNCTION (this); m_downTarget = callback; } @@ -511,6 +513,7 @@ UdpL4Protocol::GetDownTarget (void) const void UdpL4Protocol::SetDownTarget6 (IpL4Protocol::DownTargetCallback6 callback) { + NS_LOG_FUNCTION (this); m_downTarget6 = callback; }