History

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.

Willem de Bruijn committed 7 years ago

Commit 4c3024d1 parent 78c3aff2 files · +6 −6Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/skbuff.h+2−2
@@ -4232,10 +4232,10 @@ static inline bool skb_is_gso_sctp(const struct sk_buff *skb) · 4231 unmodified lines
4232 return skb_shinfo(skb)->gso_type & SKB_GSO_SCTP;4232 return skb_shinfo(skb)->gso_type & SKB_GSO_SCTP;
4233}4233}
4234 4234
4235/* Note: Should be called only if skb_is_gso(skb) is true */
4235static inline bool skb_is_gso_tcp(const struct sk_buff *skb)4236static inline bool skb_is_gso_tcp(const struct sk_buff *skb)
4236{4237{
4237 return skb_is_gso(skb) &&4238 return skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6);
4238 skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6);
4239}4239}
4240 4240
4241static inline void skb_gso_reset(struct sk_buff *skb)4241static inline void skb_gso_reset(struct sk_buff *skb)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t