Skip to content

Commit

Permalink
linklayer: Followed recent MacForwardingTable changes related to vlan…
Browse files Browse the repository at this point in the history
… ID parameter default value.
  • Loading branch information
levy committed Mar 26, 2024
1 parent 94bdd65 commit 9629b57
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/inet/linklayer/base/MacRelayUnitBase.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void MacRelayUnitBase::sendPacket(Packet *packet, const MacAddress& destinationA
send(packet, "lowerLayerOut");
}

void MacRelayUnitBase::updatePeerAddress(NetworkInterface *incomingInterface, MacAddress sourceAddress, unsigned int vlanId)
void MacRelayUnitBase::updatePeerAddress(NetworkInterface *incomingInterface, MacAddress sourceAddress, int vlanId)
{
if (!sourceAddress.isMulticast()) {
EV_INFO << "Learning peer address" << EV_FIELD(sourceAddress) << EV_FIELD(incomingInterface) << EV_ENDL;
Expand Down
2 changes: 1 addition & 1 deletion src/inet/linklayer/base/MacRelayUnitBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class INET_API MacRelayUnitBase : public LayeredProtocolBase, public StringForma
virtual bool isForwardingInterface(NetworkInterface *networkInterface) const { return !networkInterface->isLoopback() && networkInterface->isBroadcast(); }
virtual void broadcastPacket(Packet *packet, const MacAddress& destinationAddress, NetworkInterface *incomingInterface);
virtual void sendPacket(Packet *packet, const MacAddress& destinationAddress, NetworkInterface *outgoingInterface);
virtual void updatePeerAddress(NetworkInterface *incomingInterface, MacAddress sourceAddress, unsigned int vlanId);
virtual void updatePeerAddress(NetworkInterface *incomingInterface, MacAddress sourceAddress, int vlanId);

//@{ for lifecycle:
virtual void handleStartOperation(LifecycleOperation *operation) override {}
Expand Down
2 changes: 1 addition & 1 deletion src/inet/linklayer/ethernet/common/MacRelayUnit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void MacRelayUnit::handleLowerPacket(Packet *incomingPacket)
auto interfaceInd = incomingPacket->getTag<InterfaceInd>();
int incomingInterfaceId = interfaceInd->getInterfaceId();
auto incomingInterface = interfaceTable->getInterfaceById(incomingInterfaceId);
unsigned int vlanId = 0;
int vlanId = -1;
if (auto vlanInd = incomingPacket->findTag<VlanInd>())
vlanId = vlanInd->getVlanId();
EV_INFO << "Processing packet from network" << EV_FIELD(incomingInterface) << EV_FIELD(incomingPacket) << EV_ENDL;
Expand Down
4 changes: 2 additions & 2 deletions src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void Ieee8021dRelay::handleLowerPacket(Packet *incomingPacket)
auto interfaceInd = incomingPacket->getTag<InterfaceInd>();
int incomingInterfaceId = interfaceInd->getInterfaceId();
auto incomingInterface = interfaceTable->getInterfaceById(incomingInterfaceId);
unsigned int vlanId = 0;
int vlanId = -1;
if (auto vlanInd = incomingPacket->findTag<VlanInd>())
vlanId = vlanInd->getVlanId();
EV_INFO << "Processing packet from network" << EV_FIELD(incomingInterface) << EV_FIELD(incomingPacket) << EV_ENDL;
Expand Down Expand Up @@ -205,7 +205,7 @@ bool Ieee8021dRelay::isForwardingInterface(NetworkInterface *networkInterface) c
return (interfaceData == nullptr || interfaceData->isForwarding());
}

void Ieee8021dRelay::updatePeerAddress(NetworkInterface *incomingInterface, MacAddress sourceAddress, unsigned int vlanId)
void Ieee8021dRelay::updatePeerAddress(NetworkInterface *incomingInterface, MacAddress sourceAddress, int vlanId)
{
const auto& interfaceData = incomingInterface->findProtocolData<Ieee8021dInterfaceData>();
if (interfaceData == nullptr || interfaceData->isLearning())
Expand Down
2 changes: 1 addition & 1 deletion src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class INET_API Ieee8021dRelay : public MacRelayUnitBase
virtual void handleUpperPacket(Packet *packet) override;
virtual void handleLowerPacket(Packet *packet) override;

virtual void updatePeerAddress(NetworkInterface *incomingInterface, MacAddress sourceAddress, unsigned int vlanId) override;
virtual void updatePeerAddress(NetworkInterface *incomingInterface, MacAddress sourceAddress, int vlanId) override;

virtual void sendUp(Packet *packet);
virtual bool isForwardingInterface(NetworkInterface *networkInterface) const override;
Expand Down

0 comments on commit 9629b57

Please sign in to comment.