summaryrefslogtreecommitdiffstats
path: root/net/nsh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 19:25:32 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 19:25:32 +0000
commite8d3ef9fa6e1265bce5992d8f77414220b39d2d9 (patch)
tree09bf132380f6d9b925db951e6521776afea25d83 /net/nsh
parentReleasing progress-linux version 5.10.216-1progress6u1. (diff)
downloadlinux-e8d3ef9fa6e1265bce5992d8f77414220b39d2d9.tar.xz
linux-e8d3ef9fa6e1265bce5992d8f77414220b39d2d9.zip
Merging upstream version 5.10.218.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'net/nsh')
-rw-r--r--net/nsh/nsh.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net/nsh/nsh.c b/net/nsh/nsh.c
index 0f23e5e8e..3e0fc71d9 100644
--- a/net/nsh/nsh.c
+++ b/net/nsh/nsh.c
@@ -76,13 +76,15 @@ EXPORT_SYMBOL_GPL(nsh_pop);
static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
netdev_features_t features)
{
+ unsigned int outer_hlen, mac_len, nsh_len;
struct sk_buff *segs = ERR_PTR(-EINVAL);
u16 mac_offset = skb->mac_header;
- unsigned int nsh_len, mac_len;
- __be16 proto;
+ __be16 outer_proto, proto;
skb_reset_network_header(skb);
+ outer_proto = skb->protocol;
+ outer_hlen = skb_mac_header_len(skb);
mac_len = skb->mac_len;
if (unlikely(!pskb_may_pull(skb, NSH_BASE_HDR_LEN)))
@@ -112,10 +114,10 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
}
for (skb = segs; skb; skb = skb->next) {
- skb->protocol = htons(ETH_P_NSH);
- __skb_push(skb, nsh_len);
- skb->mac_header = mac_offset;
- skb->network_header = skb->mac_header + mac_len;
+ skb->protocol = outer_proto;
+ __skb_push(skb, nsh_len + outer_hlen);
+ skb_reset_mac_header(skb);
+ skb_set_network_header(skb, outer_hlen);
skb->mac_len = mac_len;
}