Skip to content

Commit 8a7f280

Browse files
Ronak Doshidavem330
authored andcommitted
vmxnet3: use correct tcp hdr length when packet is encapsulated
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]>
1 parent 519a8a6 commit 8a7f280

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/vmxnet3/vmxnet3_drv.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -886,7 +886,8 @@ vmxnet3_parse_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
886886

887887
switch (protocol) {
888888
case IPPROTO_TCP:
889-
ctx->l4_hdr_size = tcp_hdrlen(skb);
889+
ctx->l4_hdr_size = skb->encapsulation ? inner_tcp_hdrlen(skb) :
890+
tcp_hdrlen(skb);
890891
break;
891892
case IPPROTO_UDP:
892893
ctx->l4_hdr_size = sizeof(struct udphdr);

0 commit comments

Comments
 (0)