--- a/src/internet-stack/ipv4-l3-protocol.cc Tue Jul 07 16:18:55 2009 +0200
+++ b/src/internet-stack/ipv4-l3-protocol.cc Tue Jul 07 21:18:01 2009 +0200
@@ -146,12 +146,15 @@
void
Ipv4L3Protocol::NotifyNewAggregate ()
{
- Ptr<Node>node = this->GetObject<Node>();
- // verify that it's a valid node and that
- // the node has not been set before
- if (node!= 0 && m_node == 0)
+ if (m_node == 0)
{
- this->SetNode (node);
+ Ptr<Node>node = this->GetObject<Node>();
+ // verify that it's a valid node and that
+ // the node has not been set before
+ if (node != 0)
+ {
+ this->SetNode (node);
+ }
}
Object::NotifyNewAggregate ();
}