Skip to content

Commit c8c2a34

Browse files
committed
RelayInterface*: Replaced default vlan ID 0 with -1 to distinguish between the no vlan ID and vlan ID 0 cases.
1 parent c45d945 commit c8c2a34

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/inet/linklayer/ethernet/common/RelayInterfaceLearner.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ cGate *RelayInterfaceLearner::getRegistrationForwardingGate(cGate *gate)
3737

3838
void RelayInterfaceLearner::processPacket(Packet *packet)
3939
{
40-
unsigned int vid = 0;
40+
int vid = -1;
4141
if (auto vlanInd = packet->findTag<VlanInd>())
4242
vid = vlanInd->getVlanId();
4343
auto incomingInterface = interfaceTable->getInterfaceById(packet->getTag<InterfaceInd>()->getInterfaceId());

src/inet/linklayer/ethernet/common/RelayInterfaceSelector.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ void RelayInterfaceSelector::pushPacket(Packet *packet, const cGate *gates)
5353
auto interfaceInd = packet->findTag<InterfaceInd>();
5454
auto incomingInterface = interfaceInd != nullptr ? interfaceTable->getInterfaceById(interfaceInd->getInterfaceId()) : nullptr;
5555
auto vlanReq = packet->findTag<VlanReq>();
56-
int vlanId = vlanReq != nullptr ? vlanReq->getVlanId() : 0;
56+
int vlanId = vlanReq != nullptr ? vlanReq->getVlanId() : -1;
5757
if (destinationAddress.isBroadcast())
5858
broadcastPacket(packet, destinationAddress, incomingInterface);
5959
else if (destinationAddress.isMulticast()) {

0 commit comments

Comments
 (0)