summaryrefslogtreecommitdiff
path: root/net/nsh/nsh.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-28 14:55:30 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-05-28 14:55:30 +0100
commit8a29f74b7498de8b23bbbbc665b9c14ad07175d4 (patch)
tree39245b2f585068bf220da7b2291ec24cfdb11f8e /net/nsh/nsh.c
parentc21c0f9a20a963f5a1874657a4e3d657503f7815 (diff)
parent7877cb91f1081754a1487c144d85dc0d2e2e7fc4 (diff)
Merge v6.4-rc4 into char-misc-next
We need the binder fixes in here for future changes and testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/nsh/nsh.c')
-rw-r--r--net/nsh/nsh.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/net/nsh/nsh.c b/net/nsh/nsh.c
index e9ca007718b7..0f23e5e8e03e 100644
--- a/net/nsh/nsh.c
+++ b/net/nsh/nsh.c
@@ -77,13 +77,12 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
netdev_features_t features)
{
struct sk_buff *segs = ERR_PTR(-EINVAL);
+ u16 mac_offset = skb->mac_header;
unsigned int nsh_len, mac_len;
__be16 proto;
- int nhoff;
skb_reset_network_header(skb);
- nhoff = skb->network_header - skb->mac_header;
mac_len = skb->mac_len;
if (unlikely(!pskb_may_pull(skb, NSH_BASE_HDR_LEN)))
@@ -108,15 +107,14 @@ static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
segs = skb_mac_gso_segment(skb, features);
if (IS_ERR_OR_NULL(segs)) {
skb_gso_error_unwind(skb, htons(ETH_P_NSH), nsh_len,
- skb->network_header - nhoff,
- mac_len);
+ mac_offset, mac_len);
goto out;
}
for (skb = segs; skb; skb = skb->next) {
skb->protocol = htons(ETH_P_NSH);
__skb_push(skb, nsh_len);
- skb_set_mac_header(skb, -nhoff);
+ skb->mac_header = mac_offset;
skb->network_header = skb->mac_header + mac_len;
skb->mac_len = mac_len;
}