winverbs/driver: fix check for IP version
authorshefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sat, 8 Aug 2009 00:21:54 +0000 (00:21 +0000)
committershefty <shefty@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Sat, 8 Aug 2009 00:21:54 +0000 (00:21 +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/trunk@2340 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

core/winverbs/kernel/wv_ep.c

index e19e07a..72f0be8 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) == 4) {\r
+       if (hdr->IpVersion == 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