From bebead08b9af51b42b8f596e692c09d44e440dc2 Mon Sep 17 00:00:00 2001 From: Tom Henderson Date: Thu, 10 Mar 2016 16:59:27 -0800 Subject: [PATCH] internet: Cannot assume that traffic control layer is aggregated. Click routing support makes use of the Ipv4AddressHelper but nodes using click routing do not support traffic control at this time. --- src/internet/helper/ipv4-address-helper.cc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/internet/helper/ipv4-address-helper.cc b/src/internet/helper/ipv4-address-helper.cc index 5f748569b..12226226e 100644 --- a/src/internet/helper/ipv4-address-helper.cc +++ b/src/internet/helper/ipv4-address-helper.cc @@ -161,15 +161,13 @@ Ipv4AddressHelper::Assign (const NetDeviceContainer &c) ipv4->SetUp (interface); retval.Add (ipv4, interface); + // Install the default traffic control configuration if the traffic + // control layer has been aggregated, if this is not + // a loopback interface, and there is no queue disc installed already Ptr tc = node->GetObject (); - - NS_ASSERT_MSG (tc, "Ipv4AddressHelper::Assign(): NetDevice is associated" - "with a node without the Traffic Control layer installed"); - - // Install the default traffic control configuration, if this is not a loopback - // interface and there is no queue disc installed already - if (DynamicCast (device) == 0 && tc->GetRootQueueDiscOnDevice (device) == 0) + if (tc && DynamicCast (device) == 0 && tc->GetRootQueueDiscOnDevice (device) == 0) { + NS_LOG_LOGIC ("Installing default traffic control configuration"); TrafficControlHelper tcHelper = TrafficControlHelper::Default (); tcHelper.Install (device); }