OpenFastPath / ofp

OpenFastPath project
BSD 3-Clause "New" or "Revised" License
349 stars 126 forks source link

Packets corrupted at output #196

Closed JannePeltonen closed 6 years ago

JannePeltonen commented 6 years ago

ofp_ip_output_add_eth() sets l2 offset to the beginning of the packet that is to be sent but does not trim the packet buffer bytes that precede the actual packet. This leads to packet corruption since ODP ignores the offset and outputs the whole packet data that begins at odp_packet_data(pkt).

An easy way to see the problem is to forward packets from a VLAN interface to untagged ethernet interface. In that case the L2 header before l3 offset shrinks, leaving 4 extra bytes in the beginning of the packet. Those extra bytes get sent out along with the actual packet that gets shifted 4 bytes forward.