]> git.openfabrics.org - ~shefty/rdma-win.git/commitdiff
winverbs/driver: fix check for IP version (reapply overwritten commit)
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 10 Aug 2009 18:49:25 +0000 (18:49 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Mon, 10 Aug 2009 18:49:25 +0000 (18:49 +0000)
The IP version is in the upper 4 bits of an 8 bit field.  It is set
correctly, but not ready out correctly.  The result is that an IPv4
address reported to user space is listed as an IPv6 address instead.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1@2348 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

branches/winverbs/core/winverbs/kernel/wv_ep.c

index 72f0be88ff16071145900609691b196a9ccff7b1..e19e07a95ec2466db9ac9b150f0f0361dd908616 100644 (file)
@@ -1079,7 +1079,7 @@ static NTSTATUS WvEpIbListenHandler(iba_cm_id *pId, iba_cm_event *pEvent)
        pId->context = ep;\r
 \r
        hdr = pEvent->data.req.req.p_pdata;\r
-       if (hdr->IpVersion == 4) {\r
+       if ((hdr->IpVersion >> 4) == 4) {\r
                ep->Attributes.LocalAddress.SockAddr.In.SinFamily = WV_AF_INET;\r
                ep->Attributes.LocalAddress.SockAddr.In.SinAddr = hdr->DstAddress.Ip4.Address;\r
                ep->Attributes.PeerAddress.SockAddr.In.SinFamily = WV_AF_INET;\r