win-pvdrivers

changeset 601:2d022b487c64

Fix a case where rx tcp checksum calculation fails if the number of bytes in the packet is odd and the last buffer contains a single byte.
author James Harper <james.harper@bendigoit.com.au>
date Fri Jul 03 11:24:43 2009 +1000 (2009-07-03)
parents bfcba5547b8e
children 093ba74b1e6e
files xennet/xennet_rx.c
line diff
     1.1 --- a/xennet/xennet_rx.c	Thu Jul 02 21:17:37 2009 +1000
     1.2 +++ b/xennet/xennet_rx.c	Fri Jul 03 11:24:43 2009 +1000
     1.3 @@ -400,6 +400,11 @@ XenNet_SumPacketData(
     1.4    }
     1.5    if (i != total_length) // last odd byte
     1.6    {
     1.7 +    if (buffer_offset >= buffer_length)
     1.8 +    {
     1.9 +      NdisQueryBufferSafe(mdl, (PVOID) &buffer, &buffer_length, NormalPagePriority);
    1.10 +      buffer_offset = 0;
    1.11 +    }
    1.12      csum += ((USHORT)buffer[buffer_offset] << 8);
    1.13    }
    1.14    while (csum & 0xFFFF0000)