diff options
| author | 2020-03-03 16:24:00 -0800 | |
|---|---|---|
| committer | 2020-03-03 16:24:04 -0800 | |
| commit | 5fc40f37396cec199d40a417df74b39c8e458ca6 (patch) | |
| tree | e7884bbcfc7096d416345e55158d6334f8849825 /net/bpf/test_run.c | |
| parent | Merge branch 'bpf_link' (diff) | |
| parent | selftests/bpf: Test new __sk_buff field gso_size (diff) | |
| download | linux-dev-5fc40f37396cec199d40a417df74b39c8e458ca6.tar.xz linux-dev-5fc40f37396cec199d40a417df74b39c8e458ca6.zip | |
Merge branch 'bpf_gso_size'
Willem de Bruijn says:
====================
See first patch for details.
Patch split across three parts { kernel feature, uapi header, tools }
following the custom for such __sk_buff changes.
====================
Acked-by: Petar Penkov <ppenkov@google.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/bpf/test_run.c')
| -rw-r--r-- | net/bpf/test_run.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index 562443f94133..1cd7a1c2f8b2 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -277,6 +277,12 @@ static int convert___skb_to_skb(struct sk_buff *skb, struct __sk_buff *__skb) /* gso_segs is allowed */ if (!range_is_zero(__skb, offsetofend(struct __sk_buff, gso_segs), + offsetof(struct __sk_buff, gso_size))) + return -EINVAL; + + /* gso_size is allowed */ + + if (!range_is_zero(__skb, offsetofend(struct __sk_buff, gso_size), sizeof(struct __sk_buff))) return -EINVAL; @@ -297,6 +303,7 @@ static int convert___skb_to_skb(struct sk_buff *skb, struct __sk_buff *__skb) if (__skb->gso_segs > GSO_MAX_SEGS) return -EINVAL; skb_shinfo(skb)->gso_segs = __skb->gso_segs; + skb_shinfo(skb)->gso_size = __skb->gso_size; return 0; } |
