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.
Showing the changes to include/linux (1 of 2 files). Show all
Unified · Split
| @@ -4232,10 +4232,10 @@ static inline bool skb_is_gso_sctp(const struct sk_buff *skb) · 4231 unmodified lines | ||
| 4232 | 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 */ | |
| 4235 | 4236 | static inline bool skb_is_gso_tcp(const struct sk_buff *skb) |
| 4236 | 4237 | { |
| 4237 | − return skb_is_gso(skb) && | |
| 4238 | − skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6); | |
| 4238 | + return skb_shinfo(skb)->gso_type & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6); | |
| 4239 | 4239 | } |
| 4240 | 4240 | |
| 4241 | 4241 | static inline void skb_gso_reset(struct sk_buff *skb) |