VirtualBox

Ignore:
Timestamp:
Jun 4, 2009 1:39:58 PM (16 years ago)
Author:
vboxsync
Message:

#3783: Tx checksum offloading workaround for CentOS 5.2 (2.6.18).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/VBoxNetFlt-linux.c

    r20144 r20284  
    658658    {
    659659        if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING)
     660        {
     661#if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18)
     662            /*
     663             * Try to work around the problem with CentOS 5.2 (2.6.18 kernel),
     664             * it passes wrong 'h' pointer down. We take IP header length from
     665             * the header itself and reconstruct 'h' pointer to TCP (or whatever)
     666             * header.
     667             */
     668            unsigned char *tmp = pBuf->h.raw;
     669            if (pBuf->h == pBuf->nh && pBuf->protocol == htons(ETH_P_IP))
     670                pBuf->h.raw = pBuf->nh.raw + ((pBuf->nh.raw[0] & 0xF) * 4);
     671#endif /* LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18) */
    660672            if (VBOX_SKB_CHECKSUM_HELP(pBuf))
    661673            {
     
    664676                return;
    665677            }
     678#if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18)
     679            /* Restore the original (wrong) pointer. */
     680            pBuf->h.raw = tmp;
     681#endif /* LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18) */
     682        }
    666683        vboxNetFltLinuxForwardSegment(pThis, pBuf, fSrc);
    667684    }
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette