Basically I am sending a DNS query message across router to a DNS responder using DPDK libraries(dpdk-stable-19.11.10), When i am sending packet i am capturing packet using wireshark and packet looks clean. On the responsder if i do TCP dump and see the packet we are seeing malformed packets due to Bogus Ip length, bad length value of UDP.
First packet i am building from DNS header to ETHERNET header(from L7 to L2) by adding each header value. So later from the second packet instead of building again the packet, i am using '''rte_pktmbuf_clone''' function to clone the data and using '''rte_pktmbuf_mtod_offset''' function to change specific parametrs like src_mac in the ethernet, src_ip address, total_ip_len in the ipv4 header, src_port, l4_len in udp header, trans_id and query message in DNS header and sending the packets using '''rte_eth_tx_burst'''.
Checksum is offloaded to HW and no issues with that.
If we build each packet from DNS header to ETHERNET header and it works fine. After using '''rte_pktmbuf_clone''' and '''rte_pktmbuf_mtod_offset''' to change dns query, and other parameters we are seeing malformed packet or corrupting.
Any suggestion will be much appreciated thanks in advance!