projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b70086
)
nsh: set mac len based on inner packet
author
Willem de Bruijn
<
[email protected]
>
Wed, 11 Jul 2018 16:00:44 +0000
(12:00 -0400)
committer
David S. Miller
<
[email protected]
>
Thu, 12 Jul 2018 23:55:29 +0000
(16:55 -0700)
When pulling the NSH header in nsh_gso_segment, set the mac length
based on the encapsulated packet type.
skb_reset_mac_len computes an offset to the network header, which
here still points to the outer packet:
> skb_reset_network_header(skb);
> [...]
> __skb_pull(skb, nsh_len);
> skb_reset_mac_header(skb); // now mac hdr starts nsh_len == 8B after net hdr
> skb_reset_mac_len(skb); // mac len = net hdr - mac hdr == (u16) -8 == 65528
> [..]
> skb_mac_gso_segment(skb, ..)
Link:
http://lkml.kernel.org/r/CAF=yD-KeAcTSOn4AxirAxL8m7QAS8GBBe1w09eziYwvPbbUeYA@mail.gmail.com
Reported-by:
[email protected]
Fixes: c411ed854584 ("nsh: add GSO support")
Signed-off-by: Willem de Bruijn <
[email protected]
>
Acked-by: Jiri Benc <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/nsh/nsh.c
patch
|
blob
|
history
diff --git
a/net/nsh/nsh.c
b/net/nsh/nsh.c
index 9696ef96b719bf24625adea2a959deac1d2a975f..1a30e165eeb4fd1b884a0d5cd79c6823a5de9feb 100644
(file)
--- a/
net/nsh/nsh.c
+++ b/
net/nsh/nsh.c
@@
-104,7
+104,7
@@
static struct sk_buff *nsh_gso_segment(struct sk_buff *skb,
__skb_pull(skb, nsh_len);
skb_reset_mac_header(skb);
- skb
_reset_mac_len(skb)
;
+ skb
->mac_len = proto == htons(ETH_P_TEB) ? ETH_HLEN : 0
;
skb->protocol = proto;
features &= NETIF_F_SG;