VirtualBox

Ignore:
Timestamp:
Aug 11, 2020 5:05:29 PM (5 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
139838
Message:

IPRT,lnx-kmods: Use new linux kernel version checking macros. Moved them to separate wrapper header.

Location:
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux
Files:
2 edited

Legend:

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

    r85588 r85698  
    3535#include "revision-generated.h"
    3636#include "product-generated.h"
    37 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
     37#if RTLNX_VER_MIN(2,6,24)
    3838#include <linux/nsproxy.h>
    3939#endif
     
    4646#include <linux/ip.h>
    4747#include <linux/if_vlan.h>
    48 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0)
     48#if RTLNX_VER_MIN(4,5,0)
    4949#include <uapi/linux/pkt_cls.h>
    5050#endif
     
    9090#endif
    9191
    92 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
     92#if RTLNX_VER_MIN(3,11,0)
    9393# define VBOX_NETDEV_NOTIFIER_INFO_TO_DEV(ptr) netdev_notifier_info_to_dev(ptr)
    9494#else
     
    9696#endif
    9797
    98 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
     98#if RTLNX_VER_MIN(3,5,0)
    9999# define VBOX_SKB_KMAP_FRAG(frag) kmap_atomic(skb_frag_page(frag))
    100100# define VBOX_SKB_KUNMAP_FRAG(vaddr) kunmap_atomic(vaddr)
    101101#else
    102 # if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0)
     102# if RTLNX_VER_MIN(3,2,0)
    103103#  define VBOX_SKB_KMAP_FRAG(frag) kmap_atomic(skb_frag_page(frag), KM_SKB_DATA_SOFTIRQ)
    104104#  define VBOX_SKB_KUNMAP_FRAG(vaddr) kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ)
     
    109109#endif
    110110
    111 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34)
     111#if RTLNX_VER_MIN(2,6,34)
    112112# define VBOX_NETDEV_NAME(dev)              netdev_name(dev)
    113113#else
     
    115115#endif
    116116
    117 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25)
     117#if RTLNX_VER_MIN(2,6,25)
    118118# define VBOX_IPV4_IS_LOOPBACK(addr)        ipv4_is_loopback(addr)
    119119# define VBOX_IPV4_IS_LINKLOCAL_169(addr)   ipv4_is_linklocal_169(addr)
     
    123123#endif
    124124
    125 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
     125#if RTLNX_VER_MIN(2,6,22)
    126126# define VBOX_SKB_RESET_NETWORK_HDR(skb)    skb_reset_network_header(skb)
    127127# define VBOX_SKB_RESET_MAC_HDR(skb)        skb_reset_mac_header(skb)
     
    133133#endif
    134134
    135 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19)
     135#if RTLNX_VER_MIN(2,6,19)
    136136# define VBOX_SKB_CHECKSUM_HELP(skb)        skb_checksum_help(skb)
    137137#else
    138138# define CHECKSUM_PARTIAL                   CHECKSUM_HW
    139 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10)
     139# if RTLNX_VER_MIN(2,6,10)
    140140#  define VBOX_SKB_CHECKSUM_HELP(skb)       skb_checksum_help(skb, 0)
    141141# else
    142 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 7)
     142#  if RTLNX_VER_MIN(2,6,7)
    143143#   define VBOX_SKB_CHECKSUM_HELP(skb)      skb_checksum_help(&skb, 0)
    144144#  else
     
    151151#endif
    152152
    153 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
     153#if RTLNX_VER_MIN(3,20,0)
    154154# define VBOX_HAVE_SKB_VLAN
    155155#else
     
    177177#endif
    178178
    179 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
     179#if RTLNX_VER_MIN(2,6,18)
    180180
    181181/** Indicates that the linux kernel may send us GSO frames. */
     
    196196# define VBOXNETFLT_WITH_GSO_RECV           1
    197197
    198 #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) */
    199 
    200 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
     198#endif /* RTLNX_VER_MIN(2,6,18) */
     199
     200#if RTLNX_VER_MIN(2,6,29)
    201201/** This enables or disables handling of GSO frames coming from the wire (GRO). */
    202202# define VBOXNETFLT_WITH_GRO                1
     
    246246
    247247
    248 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) && defined(LOG_ENABLED)
     248#if RTLNX_VER_MAX(2,6,12) && defined(LOG_ENABLED)
    249249unsigned dev_get_flags(const struct net_device *dev)
    250250{
     
    262262    return flags;
    263263}
    264 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) */
     264#endif /* RTLNX_VER_MAX(2,6,12) */
    265265
    266266
     
    344344#ifdef VBOXNETFLT_WITH_HOST2WIRE_FILTER
    345345
    346 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
     346# if RTLNX_VER_MAX(2,6,29)
    347347
    348348# include <linux/ethtool.h>
     
    352352# define OVR_XMIT pfnStartXmit
    353353
    354 # else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
     354# else /* RTLNX_VER_MIN(2,6,29) */
    355355
    356356typedef struct net_device_ops OVR_OPSTYPE;
     
    358358# define OVR_XMIT pOrgOps->ndo_start_xmit
    359359
    360 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
     360# endif /* RTLNX_VER_MIN(2,6,29) */
    361361
    362362/**
     
    379379    /** Pointer to the original ops. */
    380380    OVR_OPSTYPE const              *pOrgOps;
    381 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
     381# if RTLNX_VER_MAX(2,6,29)
    382382    /** Pointer to the original hard_start_xmit function. */
    383383    int (*pfnStartXmit)(struct sk_buff *pSkb, struct net_device *pDev);
    384 # endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
     384# endif /* RTLNX_VER_MAX(2,6,29) */
    385385    /** Pointer to the net filter instance. */
    386386    PVBOXNETFLTINS                  pVBoxNetFlt;
     
    419419    if (   !VALID_PTR(pOverride)
    420420        || pOverride->u32Magic != VBOXNETDEVICEOPSOVERRIDE_MAGIC
    421 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29)
     421# if RTLNX_VER_MIN(2,6,29)
    422422        || !VALID_PTR(pOverride->pOrgOps)
    423 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
     423# endif /* RTLNX_VER_MIN(2,6,29) */
    424424        )
    425425    {
     
    479479    pOverride->pOrgOps              = pDev->OVR_OPS;
    480480    pOverride->Ops                  = *pDev->OVR_OPS;
    481 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
     481# if RTLNX_VER_MAX(2,6,29)
    482482    pOverride->pfnStartXmit         = pDev->hard_start_xmit;
    483 # else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
     483# else /* RTLNX_VER_MIN(2,6,29) */
    484484    pOverride->Ops.ndo_start_xmit   = vboxNetFltLinuxStartXmitFilter;
    485 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) */
     485# endif /* RTLNX_VER_MIN(2,6,29) */
    486486    pOverride->u32Magic             = VBOXNETDEVICEOPSOVERRIDE_MAGIC;
    487487    pOverride->cTotal               = 0;
     
    491491    RTSpinlockAcquire(pThis->hSpinlock); /* (this isn't necessary, but so what) */
    492492    ASMAtomicWritePtr((void * volatile *)&pDev->OVR_OPS, pOverride);
    493 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
     493# if RTLNX_VER_MAX(2,6,29)
    494494    ASMAtomicXchgPtr((void * volatile *)&pDev->hard_start_xmit, vboxNetFltLinuxStartXmitFilter);
    495 # endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
     495# endif /* RTLNX_VER_MAX(2,6,29) */
    496496    RTSpinlockRelease(pThis->hSpinlock);
    497497}
     
    519519           )
    520520        {
    521 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
     521# if RTLNX_VER_MAX(2,6,29)
    522522            ASMAtomicWritePtr((void * volatile *)&pDev->hard_start_xmit, pOverride->pfnStartXmit);
    523 # endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29) */
     523# endif /* RTLNX_VER_MAX(2,6,29) */
    524524            ASMAtomicWritePtr((void const * volatile *)&pDev->OVR_OPS, pOverride->pOrgOps);
    525525            ASMAtomicWriteU32(&pOverride->u32Magic, 0);
     
    566566            Log(("vboxNetFltLinuxRetainNetDev: Device %p(%s) retained. ref=%d\n",
    567567                 pDev, pDev->name,
    568 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
     568#if RTLNX_VER_MIN(2,6,37)
    569569                 netdev_refcnt_read(pDev)
    570570#else
     
    602602        Log(("vboxNetFltLinuxReleaseNetDev: Device %p(%s) released. ref=%d\n",
    603603             pDev, pDev->name,
    604 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
     604#if RTLNX_VER_MIN(2,6,37)
    605605             netdev_refcnt_read(pDev)
    606606#else
     
    773773        Assert(skb_headlen(pPkt) >= pSG->GsoCtx.cbHdrsTotal);
    774774        pPkt->ip_summed  = CHECKSUM_PARTIAL;
    775 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
     775# if RTLNX_VER_MIN(2,6,22)
    776776        pPkt->csum_start = skb_headroom(pPkt) + pSG->GsoCtx.offHdr2;
    777777        if (fGsoType & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6))
     
    817817DECLINLINE(unsigned) vboxNetFltLinuxGetChecksumStartOffset(struct sk_buff *pBuf)
    818818{
    819 # if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 21)
     819#if RTLNX_VER_MIN(2,6,38)
     820    return skb_checksum_start_offset(pBuf);
     821#elif RTLNX_VER_MIN(2,6,22)
     822    return pBuf->csum_start - skb_headroom(pBuf);
     823#else
    820824    unsigned char *pTransportHdr = pBuf->h.raw;
    821 #  if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
     825# if RTLNX_VER_MAX(2,6,19)
    822826    /*
    823827     * Try to work around the problem with CentOS 4.7 and 5.2 (2.6.9
     
    828832    if (pBuf->h.raw == pBuf->nh.raw && pBuf->protocol == htons(ETH_P_IP))
    829833        pTransportHdr = pBuf->nh.raw + pBuf->nh.iph->ihl * 4;
    830 #  endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */
     834# endif
    831835    return pTransportHdr - pBuf->data;
    832 # else /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 21) */
    833 #  if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
    834     return pBuf->csum_start - skb_headroom(pBuf);
    835 #  else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) */
    836     return skb_checksum_start_offset(pBuf);
    837 #  endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38) */
    838 # endif /* LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 21) */
     836#endif
    839837}
    840838
     
    867865    unsigned cbProduced = 0;
    868866
    869 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
     867# if RTLNX_VER_MIN(2,6,27)
    870868    /* Restore VLAN tag stripped by host hardware */
    871869    if (vlan_tx_tag_present(pBuf))
     
    882880        cbProduced += VLAN_ETH_HLEN;
    883881    }
    884 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
     882# endif /* RTLNX_VER_MIN(2,6,27) */
    885883
    886884    if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING)
     
    931929    {
    932930        skb_frag_t *pFrag = &skb_shinfo(pBuf)->frags[i];
    933 # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) || defined(OPENSUSE_152)
     931# if RTLNX_VER_MIN(5,4,0) || defined(OPENSUSE_152)
    934932        pSG->aSegs[iSeg].cb = pFrag->bv_len;
    935933        pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
     
    952950        {
    953951            skb_frag_t *pFrag = &skb_shinfo(pFragBuf)->frags[i];
    954 # if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) || defined(OPENSUSE_152)
     952# if RTLNX_VER_MIN(5,4,0) || defined(OPENSUSE_152)
    955953            pSG->aSegs[iSeg].cb = pFrag->bv_len;
    956954            pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset;
     
    10271025 * @returns 0 or EJUSTRETURN - this is probably copy & pastry and thus wrong.
    10281026 */
    1029 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
     1027#if RTLNX_VER_MIN(2,6,14)
    10301028static int vboxNetFltLinuxPacketHandler(struct sk_buff *pBuf,
    10311029                                        struct net_device *pSkbDev,
     
    10421040    LogFlow(("vboxNetFltLinuxPacketHandler: pBuf=%p pSkbDev=%p pPacketType=%p\n",
    10431041             pBuf, pSkbDev, pPacketType));
    1044 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
     1042#if RTLNX_VER_MIN(2,6,18)
    10451043    Log3(("vboxNetFltLinuxPacketHandler: skb len=%u data_len=%u truesize=%u next=%p nr_frags=%u gso_size=%u gso_seqs=%u gso_type=%x frag_list=%p pkt_type=%x\n",
    10461044          pBuf->len, pBuf->data_len, pBuf->truesize, pBuf->next, skb_shinfo(pBuf)->nr_frags, skb_shinfo(pBuf)->gso_size, skb_shinfo(pBuf)->gso_segs, skb_shinfo(pBuf)->gso_type, skb_shinfo(pBuf)->frag_list, pBuf->pkt_type));
    1047 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
     1045# if RTLNX_VER_MIN(2,6,22)
    10481046    Log6(("vboxNetFltLinuxPacketHandler: packet dump follows:\n%.*Rhxd\n", pBuf->len-pBuf->data_len, skb_mac_header(pBuf)));
    10491047# endif
     
    11021100        /* Somehow skb_copy ignores mac_len */
    11031101        pBuf->mac_len = uMacLen;
    1104 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
     1102# if RTLNX_VER_MIN(2,6,27)
    11051103        /* Restore VLAN tag stripped by host hardware */
    11061104        if (vlan_tx_tag_present(pBuf) && skb_headroom(pBuf) >= VLAN_ETH_HLEN)
     
    11141112            pBuf->mac_len      += VLAN_HLEN;
    11151113        }
    1116 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
    1117 
    1118 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18)
     1114# endif /* RTLNX_VER_MIN(2,6,27) */
     1115
     1116# if RTLNX_VER_MIN(2,6,18)
    11191117        Log3(("vboxNetFltLinuxPacketHandler: skb copy len=%u data_len=%u truesize=%u next=%p nr_frags=%u gso_size=%u gso_seqs=%u gso_type=%x frag_list=%p pkt_type=%x\n",
    11201118              pBuf->len, pBuf->data_len, pBuf->truesize, pBuf->next, skb_shinfo(pBuf)->nr_frags, skb_shinfo(pBuf)->gso_size, skb_shinfo(pBuf)->gso_segs, skb_shinfo(pBuf)->gso_type, skb_shinfo(pBuf)->frag_list, pBuf->pkt_type));
    1121 #  if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
     1119#  if RTLNX_VER_MIN(2,6,22)
    11221120        Log6(("vboxNetFltLinuxPacketHandler: packet dump follows:\n%.*Rhxd\n", pBuf->len-pBuf->data_len, skb_mac_header(pBuf)));
    1123 #  endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) */
    1124 # else /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
     1121#  endif /* RTLNX_VER_MIN(2,6,22) */
     1122# else /* RTLNX_VER_MAX(2,6,18) */
    11251123        Log3(("vboxNetFltLinuxPacketHandler: skb copy len=%u data_len=%u truesize=%u next=%p nr_frags=%u tso_size=%u tso_seqs=%u frag_list=%p pkt_type=%x\n",
    11261124              pBuf->len, pBuf->data_len, pBuf->truesize, pBuf->next, skb_shinfo(pBuf)->nr_frags, skb_shinfo(pBuf)->tso_size, skb_shinfo(pBuf)->tso_segs, skb_shinfo(pBuf)->frag_list, pBuf->pkt_type));
    1127 # endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) */
     1125# endif /* RTLNX_VER_MAX(2,6,18) */
    11281126    }
    11291127#endif /* !VBOXNETFLT_SG_SUPPORT */
     
    11621160        *pcbTemp = vboxNetFltLinuxGetChecksumStartOffset(pBuf) + VBOX_SKB_CSUM_OFFSET(pBuf) + sizeof(uint16_t);
    11631161    }
    1164 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
     1162# if RTLNX_VER_MIN(2,6,27)
    11651163    if (vlan_tx_tag_present(pBuf))
    11661164    {
     
    11701168            *pcbTemp = VLAN_ETH_HLEN;
    11711169    }
    1172 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) */
     1170# endif /* RTLNX_VER_MIN(2,6,27) */
    11731171    if (*pcbTemp)
    11741172        ++cSegs;
     
    15541552             * skb_gso_segment does the following. Do we need to do it as well?
    15551553             */
    1556 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22)
     1554# if RTLNX_VER_MIN(2,6,22)
    15571555            skb_reset_mac_header(pBuf);
    15581556            pBuf->mac_len = pBuf->network_header - pBuf->mac_header;
     
    16041602        if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING)
    16051603        {
    1606 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
     1604# if RTLNX_VER_MIN(2,6,19)
     1605            int rc = VBOX_SKB_CHECKSUM_HELP(pBuf);
     1606# else
    16071607            /*
    16081608             * Try to work around the problem with CentOS 4.7 and 5.2 (2.6.9
     
    16141614            if (pBuf->h.raw == pBuf->nh.raw && pBuf->protocol == htons(ETH_P_IP))
    16151615                pBuf->h.raw = pBuf->nh.raw + pBuf->nh.iph->ihl * 4;
    1616 #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */
    16171616            int rc = VBOX_SKB_CHECKSUM_HELP(pBuf);
    1618 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)
    16191617            /* Restore the original (wrong) pointer. */
    16201618            pBuf->h.raw = tmp;
    1621 #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */
    1622             if (rc) {
     1619# endif
     1620            if (rc)
     1621            {
    16231622                LogRel(("VBoxNetFlt: Failed to compute checksum, dropping the packet.\n"));
    16241623                return;
     
    16741673 * @param   pWork               The work queue.
    16751674 */
    1676 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
     1675# if RTLNX_VER_MIN(2,6,20)
    16771676static void vboxNetFltLinuxXmitTask(struct work_struct *pWork)
    16781677# else
     
    17911790            return true;
    17921791
    1793 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) /* TAP started doing carrier */
     1792#if RTLNX_VER_MIN(2,6,36) /* TAP started doing carrier */
    17941793        return !strncmp(Info.driver,   "tun", 4)
    17951794            && !strncmp(Info.bus_info, "tap", 4);
     
    18001799}
    18011800
    1802 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
     1801#if RTLNX_VER_MAX(2,6,18)
    18031802DECLINLINE(void) netif_tx_lock_bh(struct net_device *pDev)
    18041803{
     
    18531852    Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) retained. ref=%d\n",
    18541853          pDev, pDev->name,
    1855 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
     1854#if RTLNX_VER_MIN(2,6,37)
    18561855          netdev_refcnt_read(pDev)
    18571856#else
     
    19501949        Log(("vboxNetFltLinuxUnregisterDevice: Device %p(%s) released. ref=%d\n",
    19511950             pDev, pDev->name,
    1952 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
     1951#if RTLNX_VER_MIN(2,6,37)
    19531952             netdev_refcnt_read(pDev)
    19541953#else
     
    20612060    if (ulEventType == NETDEV_REGISTER)
    20622061    {
    2063 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) /* cgroups/namespaces introduced */
    2064 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)
     2062#if RTLNX_VER_MIN(2,6,24) /* cgroups/namespaces introduced */
     2063# if RTLNX_VER_MIN(2,6,26)
    20652064#  define VBOX_DEV_NET(dev)             dev_net(dev)
    20662065#  define VBOX_NET_EQ(n1, n2)           net_eq((n1), (n2))
     
    21332132     * IPv4
    21342133     */
    2135 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 14)
     2134#if RTLNX_VER_MIN(2,6,14)
    21362135    in_dev = __in_dev_get_rtnl(dev);
    21372136#else
     
    21682167
    21692168        read_lock_bh(&in6_dev->lock);
    2170 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35)
     2169#if RTLNX_VER_MIN(2,6,35)
    21712170        list_for_each_entry(ifa, &in6_dev->addr_list, if_list)
    21722171#else
     
    24722471        Log(("vboxNetFltOsDeleteInstance: Device %p(%s) released. ref=%d\n",
    24732472             pDev, pDev->name,
    2474 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)
     2473#if RTLNX_VER_MIN(2,6,37)
    24752474             netdev_refcnt_read(pDev)
    24762475#else
     
    25742573#ifndef VBOXNETFLT_LINUX_NO_XMIT_QUEUE
    25752574    skb_queue_head_init(&pThis->u.s.XmitQueue);
    2576 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
     2575# if RTLNX_VER_MIN(2,6,20)
    25772576    INIT_WORK(&pThis->u.s.XmitTask, vboxNetFltLinuxXmitTask);
    25782577# else
  • trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt

    r82968 r85698  
    6565    ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \
    6666    ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \
     67    ${PATH_ROOT}/include/iprt/linux/version.h=>include/iprt/linux/version.h \
    6768    ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \
    6869    ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
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