[ofw] [PATCH] winverbs/driver: fix check for IP version
Sean Hefty
sean.hefty at intel.com
Fri Aug 7 17:15:49 PDT 2009
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 at intel.com>
---
diff -up -r -X \mshefty\scm\winof\trunk\docs\dontdiff.txt -I '\$Id:'
trunk\core\winverbs/kernel/wv_ep.c
branches\winverbs\core\winverbs/kernel/wv_ep.c
--- trunk\core\winverbs/kernel/wv_ep.c 2009-08-07 17:14:52.192867100 -0700
+++ branches\winverbs\core\winverbs/kernel/wv_ep.c 2009-08-07
15:38:58.686479000 -0700
@@ -1079,7 +1079,7 @@ static NTSTATUS WvEpIbListenHandler(iba_
pId->context = ep;
hdr = pEvent->data.req.req.p_pdata;
- if (hdr->IpVersion == 4) {
+ if ((hdr->IpVersion >> 4) == 4) {
ep->Attributes.LocalAddress.SockAddr.In.SinFamily = WV_AF_INET;
ep->Attributes.LocalAddress.SockAddr.In.SinAddr =
hdr->DstAddress.Ip4.Address;
ep->Attributes.PeerAddress.SockAddr.In.SinFamily = WV_AF_INET;
More information about the ofw
mailing list