diff options
author | Ido Barnea <ibarnea@cisco.com> | 2017-01-01 13:35:55 +0200 |
---|---|---|
committer | Ido Barnea <ibarnea@cisco.com> | 2017-01-01 13:35:55 +0200 |
commit | fda9842014b327b1bc7cbeeea473a291568b9d1e (patch) | |
tree | eea1fa11c743921e394789490495c1bd66293cf6 /src/pkt_gen.cpp | |
parent | 355c20f88d2013e7e8d22b27a49297dc92101aa2 (diff) |
Fix --send-debug-pkt test so that VIC card will be able to work with less patches
Signed-off-by: Ido Barnea <ibarnea@cisco.com>
Diffstat (limited to 'src/pkt_gen.cpp')
-rw-r--r-- | src/pkt_gen.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pkt_gen.cpp b/src/pkt_gen.cpp index 656b1b06..9f6a3d34 100644 --- a/src/pkt_gen.cpp +++ b/src/pkt_gen.cpp @@ -123,6 +123,9 @@ char *CTestPktGen::create_test_pkt(uint16_t l3_type, uint16_t l4_proto, uint8_t pkt_size += sizeof(struct CRx_check_header); } break; + case EthernetHeader::Protocol::ARP: + pkt_size += sizeof(ArpHdr); + break; } switch (l4_proto) { @@ -192,9 +195,13 @@ char *CTestPktGen::create_test_pkt(uint16_t l3_type, uint16_t l4_proto, uint8_t ipv6->setPayloadLen(pkt_size - 14 - sizeof(ipv6_header)); ipv6->setFlowLabel(ip_id); break; + case EthernetHeader::Protocol::ARP: + uint16_t vlan = (flags & DPF_VLAN) ? 200 : 0; + create_arp_req((uint8_t *)p_start, 0x01020304, 0x05060708, src_mac, vlan, 0); + return p_start; + break; } - struct TCPHeader *tcp = (TCPHeader *)p; struct ICMPHeader *icmp= (ICMPHeader *)p; switch (l4_proto) { |