Skip to content

Commit

Permalink
We need strip the inner L2 padding bytes, before enapcasulate a packet.
Browse files Browse the repository at this point in the history
Signed-off-by: Weili Zhang <305753229@qq.com>
Signed-off-by: 0-day Robot <robot@bytheb.org>
  • Loading branch information
adobereader305753 authored and ovsrobot committed Sep 7, 2020
1 parent 11bbae9 commit b9ecca0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/netdev-native-tnl.c
Expand Up @@ -149,11 +149,15 @@ void *
netdev_tnl_push_ip_header(struct dp_packet *packet,
const void *header, int size, int *ip_tot_size)
{
int padding = dp_packet_l2_pad_size(packet);
struct eth_header *eth;
struct ip_header *ip;
struct ovs_16aligned_ip6_hdr *ip6;

eth = dp_packet_push_uninit(packet, size);
if (padding) {
dp_packet_set_size(packet, dp_packet_size(packet) - padding);
}
*ip_tot_size = dp_packet_size(packet) - sizeof (struct eth_header);

memcpy(eth, header, size);
Expand Down

0 comments on commit b9ecca0

Please sign in to comment.