VirtualBox

Changeset 20414 in vbox for trunk


Ignore:
Timestamp:
Jun 8, 2009 7:46:24 PM (16 years ago)
Author:
vboxsync
Message:

#3783: Apply the workaround to pre-2.6.18 kernels as well.

File:
1 edited

Legend:

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

    r20345 r20414  
    660660        if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING)
    661661        {
    662 #if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18)
     662#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
    663663            /*
    664              * Try to work around the problem with CentOS 5.2 (2.6.18 kernel),
    665              * it passes wrong 'h' pointer down. We take IP header length from
    666              * the header itself and reconstruct 'h' pointer to TCP (or whatever)
    667              * header.
     664             * Try to work around the problem with CentOS 4.7 and 5.2 (2.6.9
     665             * and 2.6.18 kernels), they pass wrong 'h' pointer down. We take IP
     666             * header length from the header itself and reconstruct 'h' pointer
     667             * to TCP (or whatever) header.
    668668             */
    669669            unsigned char *tmp = pBuf->h.raw;
    670670            if (pBuf->h.raw == pBuf->nh.raw && pBuf->protocol == htons(ETH_P_IP))
    671671                pBuf->h.raw = pBuf->nh.raw + pBuf->nh.iph->ihl * 4;
    672 #endif /* LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18) */
     672#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */
    673673            if (VBOX_SKB_CHECKSUM_HELP(pBuf))
    674674            {
     
    677677                return;
    678678            }
    679 #if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18)
     679#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
    680680            /* Restore the original (wrong) pointer. */
    681681            pBuf->h.raw = tmp;
    682 #endif /* LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 18) */
     682#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */
    683683        }
    684684        vboxNetFltLinuxForwardSegment(pThis, pBuf, fSrc);
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