Re: [PATCH net-next 05/15] ipv6/gso: remove temporary HBH/jumbo header
From: Eric Dumazet <edumazet@google.com>
Date: 2022-02-04 02:15:49
On Thu, Feb 3, 2022 at 5:48 PM Eric Dumazet [off-list ref] wrote:
Well, this does not work at all.quoted
static inline bool ipv6_accept_ra(struct inet6_dev *idev) { /* If forwarding is enabled, RA are not accepted unless the specialdiff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c index d37a79a8554e92a1dcaa6fd023cafe2114841ece..7f65097c8f30fa19a8c9c265eb4f027e91848021100644--- a/net/ipv6/ip6_offload.c +++ b/net/ipv6/ip6_offload.c@@ -87,6 +87,27 @@ static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, bool gso_partial; skb_reset_network_header(skb); + if (ipv6_has_hopopt_jumbo(skb)) { + const int hophdr_len = sizeof(struct hop_jumbo_hdr); + int err; + + err = skb_cow_head(skb, 0); + if (err < 0) + return ERR_PTR(err); + + /* remove the HBH header. + * Layout: [Ethernet header][IPv6 header][HBH][TCP header] + */ + memmove(skb->data + hophdr_len, + skb->data,
Oh, I must use skb_mac_header() instead of skb->data, sorry for the noise.
quoted
+ ETH_HLEN + sizeof(struct ipv6hdr)); + skb->data += hophdr_len; + skb->len -= hophdr_len; + skb->network_header += hophdr_len; + skb->mac_header += hophdr_len; + ipv6h = (struct ipv6hdr *)skb->data; + ipv6h->nexthdr = IPPROTO_TCP; + } nhoff = skb_network_header(skb) - skb_mac_header(skb); if (unlikely(!pskb_may_pull(skb, sizeof(*ipv6h)))) goto out;