Skip to content

Commit

Permalink
vmxnet3: use correct tcp hdr length when packet is encapsulated
Browse files Browse the repository at this point in the history
Commit dacce2b ("vmxnet3: add geneve and vxlan tunnel offload
support") added support for encapsulation offload. However, while
calculating tcp hdr length, it does not take into account if the
packet is encapsulated or not.

This patch fixes this issue by using correct reference for inner
tcp header.

Fixes: dacce2b ("vmxnet3: add geneve and vxlan tunnel offload support")
Signed-off-by: Ronak Doshi <[email protected]>
Acked-by: Guolin Yang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Ronak Doshi authored and davem330 committed Aug 10, 2020
1 parent 519a8a6 commit 8a7f280
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/vmxnet3/vmxnet3_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,8 @@ vmxnet3_parse_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,

switch (protocol) {
case IPPROTO_TCP:
ctx->l4_hdr_size = tcp_hdrlen(skb);
ctx->l4_hdr_size = skb->encapsulation ? inner_tcp_hdrlen(skb) :
tcp_hdrlen(skb);
break;
case IPPROTO_UDP:
ctx->l4_hdr_size = sizeof(struct udphdr);
Expand Down

0 comments on commit 8a7f280

Please sign in to comment.