Skip to content
Commit ea0371f7 authored by Peter Oskolkov's avatar Peter Oskolkov Committed by Daniel Borkmann
Browse files

net: fix GSO in bpf_lwt_push_ip_encap

GSO needs inner headers and inner protocol set properly to work.

skb->inner_mac_header: skb_reset_inner_headers() assigns the current
mac header value to inner_mac_header; but it is not set at the point,
so we need to call skb_reset_inner_mac_header, otherwise gre_gso_segment
fails: it does

    int tnl_hlen = skb_inner_mac_header(skb) - skb_transport_header(skb);
    ...
    if (unlikely(!pskb_may_pull(skb, tnl_hlen)))
    ...

skb->inner_protocol should also be correctly set.

Fixes: ca78801a

 ("bpf: handle GSO in bpf_lwt_push_encap")
Signed-off-by: default avatarPeter Oskolkov <posk@google.com>
Reviewed-by: default avatarDavid Ahern <dsahern@gmail.com>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent 915905f8
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment