Skip to content

Commit

Permalink
Use static Mac48Address broadcast address
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabrielcarvfer committed Feb 13, 2024
1 parent cf08a97 commit e1d5557
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/bridge/model/bridge-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ Address
BridgeNetDevice::GetBroadcast() const
{
NS_LOG_FUNCTION_NOARGS();
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
2 changes: 1 addition & 1 deletion src/csma/model/csma-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ Address
CsmaNetDevice::GetBroadcast() const
{
NS_LOG_FUNCTION_NOARGS();
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
2 changes: 1 addition & 1 deletion src/fd-net-device/model/fd-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ FdNetDevice::SetIsBroadcast(bool broadcast)
Address
FdNetDevice::GetBroadcast() const
{
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
2 changes: 1 addition & 1 deletion src/mesh/model/mesh-point-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ Address
MeshPointDevice::GetBroadcast() const
{
NS_LOG_FUNCTION(this);
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
2 changes: 1 addition & 1 deletion src/network/utils/simple-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ Address
SimpleNetDevice::GetBroadcast() const
{
NS_LOG_FUNCTION(this);
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
2 changes: 1 addition & 1 deletion src/openflow/model/openflow-switch-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ Address
OpenFlowSwitchNetDevice::GetBroadcast() const
{
NS_LOG_FUNCTION_NOARGS();
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
2 changes: 1 addition & 1 deletion src/point-to-point/model/point-to-point-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ Address
PointToPointNetDevice::GetBroadcast() const
{
NS_LOG_FUNCTION(this);
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
2 changes: 1 addition & 1 deletion src/spectrum/model/aloha-noack-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ Address
AlohaNoackNetDevice::GetBroadcast() const
{
NS_LOG_FUNCTION(this);
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
4 changes: 2 additions & 2 deletions src/tap-bridge/model/tap-bridge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ TapBridge::ForwardToBridgedDevice(uint8_t* buf, ssize_t len)
//
// Packets we are going to forward should not be from a broadcast src
//
NS_ASSERT_MSG(Mac48Address::ConvertFrom(src) != Mac48Address("ff:ff:ff:ff:ff:ff"),
NS_ASSERT_MSG(Mac48Address::ConvertFrom(src) != Mac48Address::GetBroadcast(),
"TapBridge::ForwardToBridgedDevice: Source addr is broadcast");
if (!m_ns3AddressRewritten)
{
Expand Down Expand Up @@ -1156,7 +1156,7 @@ Address
TapBridge::GetBroadcast() const
{
NS_LOG_FUNCTION(this);
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
6 changes: 3 additions & 3 deletions src/virtual-net-device/model/virtual-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ VirtualNetDevice::IsBroadcast() const
Address
VirtualNetDevice::GetBroadcast() const
{
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand All @@ -236,13 +236,13 @@ VirtualNetDevice::IsMulticast() const
Address
VirtualNetDevice::GetMulticast(Ipv4Address multicastGroup) const
{
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

Address
VirtualNetDevice::GetMulticast(Ipv6Address addr) const
{
return Mac48Address("ff:ff:ff:ff:ff:ff");
return Mac48Address::GetBroadcast();
}

bool
Expand Down
4 changes: 2 additions & 2 deletions src/wimax/model/bs-net-device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ BaseStationNetDevice::DoReceive(Ptr<Packet> packet)
C_Packet->RemoveHeader(llc);
source = m_ssManager->GetMacAddress(cid);
m_bsRxTrace(packet);
ForwardUp(packet->Copy(), source, Mac48Address("ff:ff:ff:ff:ff:ff"));
ForwardUp(packet->Copy(), source, Mac48Address::GetBroadcast());
}
else
{
Expand Down Expand Up @@ -861,7 +861,7 @@ BaseStationNetDevice::DoReceive(Ptr<Packet> packet)
NS_LOG_INFO("\t fullPacket size = " << fullPacket->GetSize() << std::endl);
source = m_ssManager->GetMacAddress(cid);
m_bsRxTrace(fullPacket);
ForwardUp(fullPacket->Copy(), source, Mac48Address("ff:ff:ff:ff:ff:ff"));
ForwardUp(fullPacket->Copy(), source, Mac48Address::GetBroadcast());
}
else
{
Expand Down

0 comments on commit e1d5557

Please sign in to comment.