diff options
author | Willem de Bruijn <willemb@google.com> | 2019-03-06 14:35:15 -0500 |
---|---|---|
committer | Daniel Borkmann <daniel@iogearbox.net> | 2019-03-07 10:32:24 +0100 |
commit | 4c3024debf62de4c6ac6d3cb4c0063be21d4f652 (patch) | |
tree | 0f076dcbe8e620af3420ba60a27ae6a2556897ea /include/linux/skbuff.h | |
parent | 78c3aff834f7939d1a2570e366e33f2a880d4d9e (diff) | |
download | linux-4c3024debf62de4c6ac6d3cb4c0063be21d4f652.tar.gz linux-4c3024debf62de4c6ac6d3cb4c0063be21d4f652.tar.bz2 linux-4c3024debf62de4c6ac6d3cb4c0063be21d4f652.zip |
bpf: only test gso type on gso packets
BPF can adjust gso only for tcp bytestreams. Fail on other gso types.
But only on gso packets. It does not touch this field if !gso_size.
Fixes: b90efd225874 ("bpf: only adjust gso_size on bytestream protocols")
Signed-off-by: Willem de Bruijn <willemb@google.com>
Acked-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 27beb549ffbe..f32f32407dc4 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -4232,10 +4232,10 @@ static inline bool skb_is_gso_sctp(const struct sk_buff *skb) return skb_shinfo(skb)->gso_type & SKB_GSO_SCTP; } +/* Note: Should be called only if skb_is_gso(skb) is true */ static inline bool skb_is_gso_tcp(const struct sk_buff *skb) { - return skb_is_gso(skb) && - skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6); + return skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6); } static inline void skb_gso_reset(struct sk_buff *skb) |