From 061f8a5ee11d9a53ae4821d7193e1a58c0047fed Mon Sep 17 00:00:00 2001 From: Marcel Richter <44291436+MarcelRichter-GitHub@users.noreply.github.com> Date: Tue, 30 Apr 2024 17:38:04 +0200 Subject: [PATCH] Update MacForwardingTable file reader to include check for Multicast --- .../linklayer/ethernet/common/MacForwardingTable.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/inet/linklayer/ethernet/common/MacForwardingTable.cc b/src/inet/linklayer/ethernet/common/MacForwardingTable.cc index 82ae2db850b..54547dda09f 100644 --- a/src/inet/linklayer/ethernet/common/MacForwardingTable.cc +++ b/src/inet/linklayer/ethernet/common/MacForwardingTable.cc @@ -339,10 +339,14 @@ void MacForwardingTable::readForwardingTable(const char *fileName) throw cRuntimeError("error in line %d in address table file `%s': interface '%s' not found", lineno, fileName, interfaceName); interfaceId = ie->getInterfaceId(); - // Create an entry with address and interfaceId and insert into table - AddressEntry entry(vlanId, interfaceId, 0); - ForwardingTableKey key(vlanId, macAddress); - forwardingTable[key] = entry; + if (macAddress.isMulticast()) { + addMulticastAddressForwardingInterface(interfaceId, macAddress, vlanId); + } else { + // Create an entry with address and interfaceId and insert into table + AddressEntry entry(vlanId, interfaceId, 0); + ForwardingTableKey key(vlanId, macAddress); + forwardingTable[key] = entry; + } } fclose(fp); }