Skip to content

Commit 0482bb4

Browse files
fix Ipv6NS answer matcher
1 parent 09c33c3 commit 0482bb4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ public EthernetPacket sendNeighborSolicitation(
214214
long endTs = System.currentTimeMillis() + timeout * 1000;
215215

216216
final String multicastMac = dstMac != null ? dstMac : multicastMacFromIPv6(dstIp).toString();
217+
final String specifiedSrcIP = srcIp != null ? srcIp : generateIPv6AddrFromMAC(srcMac);
217218

218-
Packet icmpv6NSPkt = buildICMPV6NSPkt(vlan, srcMac, multicastMac, dstIp, srcIp);
219+
Packet icmpv6NSPkt = buildICMPV6NSPkt(vlan, srcMac, multicastMac, dstIp, specifiedSrcIP);
219220
LOGGER.trace("Sending IPv6 Neighbor Solicitation packet:\n{}", icmpv6NSPkt);
220221
tRexClient.startStreamsIntermediate(portIdx, Arrays.asList(buildStream(icmpv6NSPkt)));
221222

@@ -235,7 +236,7 @@ public EthernetPacket sendNeighborSolicitation(
235236
try {
236237
Inet6Address dstIPv6Addr = (Inet6Address) InetAddress.getByName(dstAddr);
237238
Inet6Address srcIPv6Addr =
238-
(Inet6Address) InetAddress.getByName(generateIPv6AddrFromMAC(srcMac));
239+
(Inet6Address) InetAddress.getByName(specifiedSrcIP);
239240

240241
Inet6Address nodeIpv6 = (Inet6Address) InetAddress.getByName(nodeIp);
241242
Inet6Address targetIpv6inNS = (Inet6Address) InetAddress.getByName(dstIp);

0 commit comments

Comments
 (0)