Re: [RFC PATCH net] ipv4: ip_gre: Fix drops of small packets in ipgre_xmit

From: Eric Dumazet
Date: Sun Sep 22 2024 - 06:20:33 EST


On Sat, Sep 21, 2024 at 11:55 PM Anton Danilov
<littlesmilingcloud@xxxxxxxxx> wrote:
>
> Regression Description:
>
> Depending on the GRE tunnel device options, small packets are being
> dropped. This occurs because the pskb_network_may_pull function fails due
> to insufficient space in the network header. For example, if only the key
> option is specified for the tunnel device, packets of sizes up to 27
> (including the IPv4 header itself) will be dropped. This affects both
> locally originated and forwarded packets.
>
> How to reproduce (for local originated packets):
>
> ip link add dev gre1 type gre ikey 1.9.8.4 okey 1.9.8.4 \
> local <your-ip> remote <any-ip>
>
> ip link set mtu 1400 dev gre1
> ip link set up dev gre1
> ip address add 192.168.13.1/24 dev gre1
> ping -s 1374 -c 10 192.168.13.2

This size does not match the changelog ? (packets of sizes up to 27...)

> tcpdump -vni gre1
> tcpdump -vni <your-ext-iface> 'ip proto 47'
> ip -s -s -d link show dev gre1

Please provide a real selftest, because in this particular example,
the path taken by the packets should not reach the
pskb_network_may_pull(skb, pull_len)),
because dev->header_ops should be NULL ?