Skip to content

Commit

Permalink
Update MacForwardingTable file reader to include check for Multicast
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelRichter-GitHub authored and ZoltanBojthe committed Jun 27, 2024
1 parent 2bbe4ac commit 061f8a5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/inet/linklayer/ethernet/common/MacForwardingTable.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 061f8a5

Please sign in to comment.