Commit 43537b8e authored by Willem de Bruijn's avatar Willem de Bruijn Committed by Daniel Borkmann

bpf: reserve flags in bpf_skb_net_shrink

The ENCAP flags in bpf_skb_adjust_room are ignored on decap with
bpf_skb_net_shrink. Reserve these bits for future use.

Fixes: 868d5235 ("bpf: add bpf_skb_adjust_room encap flags")
Signed-off-by: default avatarWillem de Bruijn <willemb@google.com>
Reviewed-by: default avatarAlan Maguire <alan.maguire@oracle.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent bfb35c27
...@@ -3069,6 +3069,9 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff, ...@@ -3069,6 +3069,9 @@ static int bpf_skb_net_shrink(struct sk_buff *skb, u32 off, u32 len_diff,
{ {
int ret; int ret;
if (flags & ~BPF_F_ADJ_ROOM_FIXED_GSO)
return -EINVAL;
if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) { if (skb_is_gso(skb) && !skb_is_gso_tcp(skb)) {
/* udp gso_size delineates datagrams, only allow if fixed */ /* udp gso_size delineates datagrams, only allow if fixed */
if (!(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) || if (!(skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4) ||
......
Markdown is supported
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