Skip to content

Commit d554e74

Browse files
committed
bypass arp with vlan if no vlan configured on ports
Signed-off-by: Leo Ma <[email protected]>
1 parent c803246 commit d554e74

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/java/com/cisco/trex/stateless/TRexClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,8 @@ public String resolveArp(
570570
etherPkt.getRawData(),
571571
etherPkt.getHeader().length(),
572572
etherPkt.getPayload().length());
573-
vlanOutsideMatches = qInqPkt.getHeader().getVidAsInt() == vlanTags.poll();
573+
vlanOutsideMatches =
574+
!vlanTags.isEmpty() && qInqPkt.getHeader().getVidAsInt() == vlanTags.poll();
574575

575576
nextPkt = qInqPkt.getPayload();
576577
} catch (IllegalRawDataException e) {
@@ -581,7 +582,8 @@ public String resolveArp(
581582
boolean vlanInsideMatches = true;
582583
if (nextPkt.contains(Dot1qVlanTagPacket.class)) {
583584
Dot1qVlanTagPacket dot1qVlanTagPacket = nextPkt.get(Dot1qVlanTagPacket.class);
584-
vlanInsideMatches = dot1qVlanTagPacket.getHeader().getVid() == vlanTags.poll();
585+
vlanInsideMatches =
586+
!vlanTags.isEmpty() && dot1qVlanTagPacket.getHeader().getVid() == vlanTags.poll();
585587
}
586588

587589
if (nextPkt.contains(ArpPacket.class)) {

0 commit comments

Comments
 (0)