diff options
author | Ronak Doshi <doshir@vmware.com> | 2020-08-10 18:55:55 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-08-10 21:09:38 +0200 |
commit | 8a7f280f29a80f6e0798f5d6e07c5dd8726620fe (patch) | |
tree | d068680dba9e82d89b598e7445e97dcf5c5fb28d /drivers/net/vmxnet3 | |
parent | net: Revert "net: optimize the sockptr_t for unified kernel/user address spaces" (diff) | |
download | linux-8a7f280f29a80f6e0798f5d6e07c5dd8726620fe.tar.xz linux-8a7f280f29a80f6e0798f5d6e07c5dd8726620fe.zip |
vmxnet3: use correct tcp hdr length when packet is encapsulated
Commit dacce2be3312 ("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: dacce2be3312 ("vmxnet3: add geneve and vxlan tunnel offload support")
Signed-off-by: Ronak Doshi <doshir@vmware.com>
Acked-by: Guolin Yang <gyang@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/vmxnet3')
-rw-r--r-- | drivers/net/vmxnet3/vmxnet3_drv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index ca395f9679d0..2818015324b8 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c @@ -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); |