|
11 | 11 | import com.cisco.trex.stateless.model.StreamVM; |
12 | 12 | import com.cisco.trex.stateless.model.TRexClientResult; |
13 | 13 | import com.cisco.trex.stateless.model.port.PortVlan; |
14 | | -import com.cisco.trex.stateless.model.vm.FixChecksumHw; |
15 | | -import com.cisco.trex.stateless.model.vm.FixChecksumHw.L4Type; |
16 | 14 | import com.cisco.trex.stateless.model.vm.VMInstruction; |
17 | 15 | import com.google.common.collect.Lists; |
18 | 16 | import com.google.common.net.InetAddresses; |
@@ -219,14 +217,7 @@ public EthernetPacket sendNeighborSolicitation( |
219 | 217 | } |
220 | 218 |
|
221 | 219 | Packet icmpv6NSPkt = buildICMPV6NSPkt(vlan, srcMac, dstMac, dstIp, srcIp); |
222 | | - List<VMInstruction> instructions = new ArrayList<>(); |
223 | | - int layer2Length = L2LENGTH; |
224 | | - if (!vlan.getTags().isEmpty()) { |
225 | | - layer2Length = 18; |
226 | | - } |
227 | | - instructions.add(new FixChecksumHw(layer2Length, L3LENGTH, L4Type.IP)); |
228 | | - tRexClient.startStreamsIntermediate( |
229 | | - portIdx, Arrays.asList(buildStream(icmpv6NSPkt, instructions))); |
| 220 | + tRexClient.startStreamsIntermediate(portIdx, Arrays.asList(buildStream(icmpv6NSPkt))); |
230 | 221 |
|
231 | 222 | Predicate<EthernetPacket> ipV6NAPktFilter = |
232 | 223 | etherPkt -> { |
@@ -366,7 +357,7 @@ private static com.cisco.trex.stateless.model.Stream buildStream( |
366 | 357 | return new com.cisco.trex.stateless.model.Stream( |
367 | 358 | streamId, |
368 | 359 | true, |
369 | | - 3, |
| 360 | + 0, |
370 | 361 | 0.0, |
371 | 362 | new StreamMode( |
372 | 363 | 2, |
@@ -403,21 +394,21 @@ private static Packet buildICMPV6NSPkt( |
403 | 394 |
|
404 | 395 | final String specifiedSrcIP = srcIp != null ? srcIp : generateIPv6AddrFromMAC(srcMac); |
405 | 396 |
|
| 397 | + // Calculate the Solicited-Node multicast address, RFC 4291 chapter 2.7.1 |
| 398 | + String[] destIpParts = dstIp.split(":"); |
| 399 | + String multicastIp = |
| 400 | + String.format( |
| 401 | + "FF02::1:FF%s:%s", destIpParts[6].substring(2, 4), destIpParts[7].substring(0, 4)); |
| 402 | + |
406 | 403 | IcmpV6CommonPacket.Builder icmpCommonPktBuilder = new IcmpV6CommonPacket.Builder(); |
407 | 404 | icmpCommonPktBuilder |
408 | 405 | .srcAddr((Inet6Address) InetAddress.getByName(specifiedSrcIP)) |
409 | | - .dstAddr((Inet6Address) InetAddress.getByName(dstIp)) |
| 406 | + .dstAddr((Inet6Address) InetAddress.getByName(multicastIp)) |
410 | 407 | .type(IcmpV6Type.NEIGHBOR_SOLICITATION) |
411 | 408 | .code(IcmpV6Code.NO_CODE) |
412 | 409 | .correctChecksumAtBuild(true) |
413 | 410 | .payloadBuilder(ipv6NSBuilder); |
414 | 411 |
|
415 | | - // Calculate the Solicited-Node multicast address, RFC 4291 chapter 2.7.1 |
416 | | - String[] destIpParts = dstIp.split(":"); |
417 | | - String multicastIp = |
418 | | - String.format( |
419 | | - "FF02::1:FF%s:%s", destIpParts[6].substring(2, 4), destIpParts[7].substring(0, 4)); |
420 | | - |
421 | 412 | IpV6Packet.Builder ipV6Builder = new IpV6Packet.Builder(); |
422 | 413 | ipV6Builder |
423 | 414 | .srcAddr((Inet6Address) InetAddress.getByName(specifiedSrcIP)) |
|
0 commit comments