VirtualBox

Ignore:
Timestamp:
Oct 11, 2016 7:45:50 AM (8 years ago)
Author:
vboxsync
Message:

NetFlt/Linux (bugref:8599) Build fixes for r111185

File:
1 edited

Legend:

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

    r64194 r64195  
    8787#endif
    8888
     89#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
     90# define VBOX_SKB_PAGE(page) page.p
     91#else
     92# define VBOX_SKB_PAGE(page) page
     93#endif
     94
    8995#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
    9096# define VBOX_NETDEV_NAME(dev)              netdev_name(dev)
     
    104110# define VBOX_SKB_RESET_NETWORK_HDR(skb)    skb_reset_network_header(skb)
    105111# define VBOX_SKB_RESET_MAC_HDR(skb)        skb_reset_mac_header(skb)
     112# define VBOX_SKB_CSUM_OFFSET(skb)          skb->csum_offset
    106113#else
    107114# define VBOX_SKB_RESET_NETWORK_HDR(skb)    skb->nh.raw = skb->data
    108115# define VBOX_SKB_RESET_MAC_HDR(skb)        skb->mac.raw = skb->data
     116# define VBOX_SKB_CSUM_OFFSET(skb)          skb->csum
    109117#endif
    110118
     
    853861    {
    854862        unsigned uCsumStartOffset = vboxNetFltLinuxGetChecksumStartOffset(pBuf);
    855         unsigned uCsumStoreOffset = uCsumStartOffset + pBuf->csum_offset - cbConsumed;
     863        unsigned uCsumStoreOffset = uCsumStartOffset + VBOX_SKB_CSUM_OFFSET(pBuf) - cbConsumed;
    856864        Log3(("cbConsumed=%u cbProduced=%u uCsumStartOffset=%u uCsumStoreOffset=%u\n",
    857865              cbConsumed, cbProduced, uCsumStartOffset, uCsumStoreOffset));
     
    898906        skb_frag_t *pFrag = &skb_shinfo(pBuf)->frags[i];
    899907        pSG->aSegs[iSeg].cb = pFrag->size;
    900         pSG->aSegs[iSeg].pv = kmap_atomic(pFrag->page.p) + pFrag->page_offset;
     908        pSG->aSegs[iSeg].pv = kmap_atomic(VBOX_SKB_PAGE(pFrag->page)) + pFrag->page_offset;
    901909        Log6((" %p", pSG->aSegs[iSeg].pv));
    902910        pSG->aSegs[iSeg++].Phys = NIL_RTHCPHYS;
     
    914922            skb_frag_t *pFrag = &skb_shinfo(pFragBuf)->frags[i];
    915923            pSG->aSegs[iSeg].cb = pFrag->size;
    916             pSG->aSegs[iSeg].pv = kmap_atomic(pFrag->page.p) + pFrag->page_offset;
     924            pSG->aSegs[iSeg].pv = kmap_atomic(VBOX_SKB_PAGE(pFrag->page)) + pFrag->page_offset;
    917925            Log6((" %p", pSG->aSegs[iSeg].pv));
    918926            pSG->aSegs[iSeg++].Phys = NIL_RTHCPHYS;
     
    11011109    if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING)
    11021110    {
    1103         *pcbTemp = vboxNetFltLinuxGetChecksumStartOffset(pBuf) + pBuf->csum_offset + sizeof(uint16_t);
     1111        *pcbTemp = vboxNetFltLinuxGetChecksumStartOffset(pBuf) + VBOX_SKB_CSUM_OFFSET(pBuf) + sizeof(uint16_t);
    11041112    }
    11051113# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
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