On Thu, May 30, 2019 at 10:35:08AM +0200, Steinar H. Gunderson wrote: > After looking at the GRE packets in Wireshark, it turns out the Ethernet > packets within the EoGRE packet is undersized (under 60 bytes), and Linux > doesn't pad them. I haven't found anything in RFC 7637 that says anything > about padding, so I would assume it should conform to the usual Ethernet > padding rules, ie., pad to at least ETH_ZLEN. However, nothing in Linux' IP > stack seems to actually do this, which means that when the packet is > decapsulated in the other end and put on the (potentially virtual) wire, > it gets dropped. The other system properly pads its small frames when sending > them.
As a proof of concept (no error handling, probably poor performance, not implemented for IPv6, other issues?), this patch works and fixes my problem: diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 4b0526441476..00be99d23e5c 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c @@ -441,6 +441,11 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev, if (tunnel->parms.o_flags & TUNNEL_SEQ) tunnel->o_seqno++; + if (proto == htons(ETH_P_TEB) && skb->len < ETH_ZLEN) { + skb_cow(skb, dev->needed_headroom + ETH_ZLEN - skb->len); + skb_put_zero(skb, ETH_ZLEN - skb->len); + } + /* Push GRE header. */ gre_build_header(skb, tunnel->tun_hlen, tunnel->parms.o_flags, proto, tunnel->parms.o_key, If I apply the patch on the side with the gretap tunnel, the ARP packets are properly padded, and seen by the host in the other end. /* Steinar */ -- Homepage: https://www.sesse.net/