diff --git a/src/inet/linklayer/base/MacRelayUnitBase.cc b/src/inet/linklayer/base/MacRelayUnitBase.cc index 95d6d5f7a035..61d2be864887 100644 --- a/src/inet/linklayer/base/MacRelayUnitBase.cc +++ b/src/inet/linklayer/base/MacRelayUnitBase.cc @@ -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; diff --git a/src/inet/linklayer/base/MacRelayUnitBase.h b/src/inet/linklayer/base/MacRelayUnitBase.h index 0901182690ce..9c48f7283e26 100644 --- a/src/inet/linklayer/base/MacRelayUnitBase.h +++ b/src/inet/linklayer/base/MacRelayUnitBase.h @@ -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 {} diff --git a/src/inet/linklayer/ethernet/common/MacRelayUnit.cc b/src/inet/linklayer/ethernet/common/MacRelayUnit.cc index 60c6b97e0169..e6ee74786d89 100644 --- a/src/inet/linklayer/ethernet/common/MacRelayUnit.cc +++ b/src/inet/linklayer/ethernet/common/MacRelayUnit.cc @@ -28,7 +28,7 @@ void MacRelayUnit::handleLowerPacket(Packet *incomingPacket) auto interfaceInd = incomingPacket->getTag(); int incomingInterfaceId = interfaceInd->getInterfaceId(); auto incomingInterface = interfaceTable->getInterfaceById(incomingInterfaceId); - unsigned int vlanId = 0; + int vlanId = -1; if (auto vlanInd = incomingPacket->findTag()) vlanId = vlanInd->getVlanId(); EV_INFO << "Processing packet from network" << EV_FIELD(incomingInterface) << EV_FIELD(incomingPacket) << EV_ENDL; diff --git a/src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.cc b/src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.cc index df8dafbb22cc..eb7e503c9f09 100644 --- a/src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.cc +++ b/src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.cc @@ -58,7 +58,7 @@ void Ieee8021dRelay::handleLowerPacket(Packet *incomingPacket) auto interfaceInd = incomingPacket->getTag(); int incomingInterfaceId = interfaceInd->getInterfaceId(); auto incomingInterface = interfaceTable->getInterfaceById(incomingInterfaceId); - unsigned int vlanId = 0; + int vlanId = -1; if (auto vlanInd = incomingPacket->findTag()) vlanId = vlanInd->getVlanId(); EV_INFO << "Processing packet from network" << EV_FIELD(incomingInterface) << EV_FIELD(incomingPacket) << EV_ENDL; @@ -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(); if (interfaceData == nullptr || interfaceData->isLearning()) diff --git a/src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.h b/src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.h index e1661350c6a7..cbec55dca027 100644 --- a/src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.h +++ b/src/inet/linklayer/ieee8021d/relay/Ieee8021dRelay.h @@ -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;