From: Amiram Perlmutter Date: Sun, 25 Feb 2007 09:57:47 +0000 (+0200) Subject: IB/sdp: fix BSDH len field for HH/HAH login messages. X-Git-Tag: v4.1.12-92~264^2~5^2~361 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=babe5b8725d1105c085c0dfe9a8c42c63c762c60;p=users%2Fjedix%2Flinux-maple.git IB/sdp: fix BSDH len field for HH/HAH login messages. Signed-off-by: Amiram Perlmutter Signed-off-by: Michael S. Tsirkin --- diff --git a/drivers/infiniband/ulp/sdp/sdp_cma.c b/drivers/infiniband/ulp/sdp/sdp_cma.c index 59c805205e9c5..64a90fd2258ff 100644 --- a/drivers/infiniband/ulp/sdp/sdp_cma.c +++ b/drivers/infiniband/ulp/sdp/sdp_cma.c @@ -81,6 +81,11 @@ struct sdp_hah { __u32 actrcvsz; }; +enum { + SDP_HH_SIZE = 76, + SDP_HAH_SIZE = 180, +}; + static void sdp_cq_event_handler(struct ib_event *event, void *data) { } @@ -379,7 +384,7 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) memset(&hh, 0, sizeof hh); hh.bsdh.mid = SDP_MID_HELLO; hh.bsdh.bufs = htons(sdp_sk(sk)->remote_credits); - hh.bsdh.len = sizeof(hh); + hh.bsdh.len = htonl(sizeof(struct sdp_bsdh) + SDP_HH_SIZE); hh.max_adverts = 1; hh.majv_minv = SDP_MAJV_MINV; hh.localrcvsz = hh.desremrcvsz = htonl(SDP_MAX_SEND_SKB_FRAGS * @@ -412,7 +417,7 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event) memset(&hah, 0, sizeof hah); hah.bsdh.mid = SDP_MID_HELLO_ACK; hah.bsdh.bufs = htons(sdp_sk(child)->remote_credits); - hah.bsdh.len = sizeof(hah); + hah.bsdh.len = htonl(sizeof(struct sdp_bsdh) + SDP_HAH_SIZE); hah.majv_minv = SDP_MAJV_MINV; hah.ext_max_adverts = 1; /* Doesn't seem to be mandated by spec, but just in case */