From a3ed490b7f493cb19189d0cd70bd33a0a545b535 Mon Sep 17 00:00:00 2001 From: Mathieu Lacage Date: Wed, 19 Mar 2008 11:19:29 -0700 Subject: [PATCH] call SetAddress during construction to assign MAC-level addresses. --- src/helper/csma-helper.cc | 1 + src/helper/point-to-point-helper.cc | 2 ++ src/helper/wifi-helper.cc | 1 + 3 files changed, 4 insertions(+) diff --git a/src/helper/csma-helper.cc b/src/helper/csma-helper.cc index bd4723b26..f941306c1 100644 --- a/src/helper/csma-helper.cc +++ b/src/helper/csma-helper.cc @@ -55,6 +55,7 @@ CsmaHelper::Build (const NodeContainer &c, Ptr channel) { Ptr node = *i; Ptr device = m_deviceFactory.Create (); + device->SetAddress (Mac48Address::Allocate ()); node->AddDevice (device); Ptr queue = m_queueFactory.Create (); device->AddQueue (queue); diff --git a/src/helper/point-to-point-helper.cc b/src/helper/point-to-point-helper.cc index 33f34979d..5a7570d80 100644 --- a/src/helper/point-to-point-helper.cc +++ b/src/helper/point-to-point-helper.cc @@ -48,10 +48,12 @@ PointToPointHelper::Build (Ptr a, Ptr b) NetDeviceContainer container; Ptr devA = CreateObject (); + devA->SetAddress (Mac48Address::Allocate ()); a->AddDevice (devA); Ptr queueA = m_queueFactory.Create (); devA->AddQueue (queueA); Ptr devB = CreateObject (); + devB->SetAddress (Mac48Address::Allocate ()); b->AddDevice (devB); Ptr queueB = m_queueFactory.Create (); devB->AddQueue (queueB); diff --git a/src/helper/wifi-helper.cc b/src/helper/wifi-helper.cc index d9b990574..76926b718 100644 --- a/src/helper/wifi-helper.cc +++ b/src/helper/wifi-helper.cc @@ -110,6 +110,7 @@ WifiHelper::Build (NodeContainer c, Ptr channel) const Ptr manager = m_stationManager.Create (); Ptr mac = m_mac.Create (); Ptr phy = m_phy.Create (); + mac->SetAddress (Mac48Address::Allocate ()); device->SetMac (mac); device->SetPhy (phy); device->SetRemoteStationManager (manager);