diff options
| author | Thomas Gleixner <tglx@linutronix.de> | 2025-11-22 19:07:57 +0300 |
|---|---|---|
| committer | Thomas Gleixner <tglx@linutronix.de> | 2025-11-22 19:07:57 +0300 |
| commit | ebb922c920cefbeb2ce93775a66da0df479661cc (patch) | |
| tree | d1629e2317a08aebd9c351916676054a42e7a6df /include/net | |
| parent | ac646f44956edc9aaa406b4a8fef17888a2166af (diff) | |
| parent | dcb6fa37fd7bc9c3d2b066329b0d27dedf8becaa (diff) | |
| download | linux-ebb922c920cefbeb2ce93775a66da0df479661cc.tar.xz | |
Merge tag 'v6.18-rc3' into irq/msi
Pick up OF changes to resolve dependencies
Diffstat (limited to 'include/net')
| -rw-r--r-- | include/net/ip_tunnels.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h index 4314a97702ea..ecae35512b9b 100644 --- a/include/net/ip_tunnels.h +++ b/include/net/ip_tunnels.h @@ -611,6 +611,21 @@ struct metadata_dst *iptunnel_metadata_reply(struct metadata_dst *md, int skb_tunnel_check_pmtu(struct sk_buff *skb, struct dst_entry *encap_dst, int headroom, bool reply); +static inline void ip_tunnel_adj_headroom(struct net_device *dev, + unsigned int headroom) +{ + /* we must cap headroom to some upperlimit, else pskb_expand_head + * will overflow header offsets in skb_headers_offset_update(). + */ + const unsigned int max_allowed = 512; + + if (headroom > max_allowed) + headroom = max_allowed; + + if (headroom > READ_ONCE(dev->needed_headroom)) + WRITE_ONCE(dev->needed_headroom, headroom); +} + int iptunnel_handle_offloads(struct sk_buff *skb, int gso_type_mask); static inline int iptunnel_pull_offloads(struct sk_buff *skb) |
