Hi,team.
    Some switches add padding bytes to packets smaller than 64 bytes that are 
sent from outside. 
However, in our netdev_tnl_push_ip_header processing, we directly set 
l2_pad_size to 0. 
I believe that l2_pad_size should be reassigned with the value it originally 
carried.
After making this modification, the L4 checksum for my inner packets became 
correct.

https://github.com/openvswitch/ovs/blob/main/lib/netdev-native-tnl.c#L166 

Currently, I can resolve the issue with the following modification, but I am 
unsure if this 
approach is the most correct, or if there are other places that also need the 
same modification.

diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
index dd598ce31..1084dbe91 100644
--- a/lib/netdev-native-tnl.c
+++ b/lib/netdev-native-tnl.c
@@ -163,7 +163,9 @@ netdev_tnl_push_ip_header(struct dp_packet *packet,
     memcpy(eth, header, size);
     /* The encapsulated packet has type Ethernet. Adjust dp_packet. */
     packet->packet_type = htonl(PT_ETH);
+    uint16_t l2_pad_size = packet->l2_pad_size;
     dp_packet_reset_offsets(packet);
+    packet->l2_pad_size = l2_pad_size;
     packet->l3_ofs = sizeof (struct eth_header);

Thanks.



Jun Wang
_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss

Reply via email to