]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
RDMA/iw_cxgb4: fix the calculation of ipv6 header size
authorRaju Rangoju <rajur@chelsio.com>
Wed, 31 May 2017 06:36:58 +0000 (12:06 +0530)
committerDoug Ledford <dledford@redhat.com>
Thu, 1 Jun 2017 21:03:02 +0000 (17:03 -0400)
Take care of ipv6 checks while computing header length for deducing mtu
size of ipv6 servers. Due to the incorrect header length computation for
ipv6 servers, wrong mss is reported to the peer (client).

Signed-off-by: Raju Rangoju <rajur@chelsio.com>
Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/cxgb4/cm.c

index 06b110213e92986b1180729a13bcc69acd81df2e..0910faf3587b547e873bc4e5572e7defd93623b3 100644 (file)
@@ -2521,7 +2521,8 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
                goto reject;
        }
 
-       hdrs = sizeof(struct iphdr) + sizeof(struct tcphdr) +
+       hdrs = ((iptype == 4) ? sizeof(struct iphdr) : sizeof(struct ipv6hdr)) +
+              sizeof(struct tcphdr) +
               ((enable_tcp_timestamps && req->tcpopt.tstamp) ? 12 : 0);
        if (peer_mss && child_ep->mtu > (peer_mss + hdrs))
                child_ep->mtu = peer_mss + hdrs;