Skip to content

Commit

Permalink
MacRelayUnit: Fixed sending out the outgoingPacket instead of the inc…
Browse files Browse the repository at this point in the history
…omingPacket.

This was a copy-paste bug.
  • Loading branch information
levy committed Mar 20, 2024
1 parent 40c1190 commit 61410b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/inet/linklayer/ethernet/common/MacRelayUnit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ void MacRelayUnit::handleLowerPacket(Packet *incomingPacket)
else if (destinationAddress.isMulticast()) {
auto outgoingInterfaceIds = macForwardingTable->getMulticastAddressForwardingInterfaces(destinationAddress, vlanId);
if (outgoingInterfaceIds.size() == 0)
broadcastPacket(incomingPacket, destinationAddress, incomingInterface);
broadcastPacket(outgoingPacket, destinationAddress, incomingInterface);
else {
for (auto outgoingInterfaceId : outgoingInterfaceIds) {
if (interfaceInd != nullptr && outgoingInterfaceId == interfaceInd->getInterfaceId())
EV_WARN << "Ignoring outgoing interface because it is the same as incoming interface" << EV_FIELD(destinationAddress) << EV_FIELD(incomingInterface) << EV_FIELD(incomingPacket) << EV_ENDL;
else {
auto outgoingInterface = interfaceTable->getInterfaceById(outgoingInterfaceId);
sendPacket(incomingPacket->dup(), destinationAddress, outgoingInterface);
sendPacket(outgoingPacket->dup(), destinationAddress, outgoingInterface);
}
}
delete incomingPacket;
delete outgoingPacket;
}
}
else {
Expand Down

0 comments on commit 61410b4

Please sign in to comment.