Changeset 85698 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/linux
- Timestamp:
- Aug 11, 2020 5:05:29 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 139838
- 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 35 35 #include "revision-generated.h" 36 36 #include "product-generated.h" 37 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,24)37 #if RTLNX_VER_MIN(2,6,24) 38 38 #include <linux/nsproxy.h> 39 39 #endif … … 46 46 #include <linux/ip.h> 47 47 #include <linux/if_vlan.h> 48 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5,0)48 #if RTLNX_VER_MIN(4,5,0) 49 49 #include <uapi/linux/pkt_cls.h> 50 50 #endif … … 90 90 #endif 91 91 92 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11,0)92 #if RTLNX_VER_MIN(3,11,0) 93 93 # define VBOX_NETDEV_NOTIFIER_INFO_TO_DEV(ptr) netdev_notifier_info_to_dev(ptr) 94 94 #else … … 96 96 #endif 97 97 98 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5,0)98 #if RTLNX_VER_MIN(3,5,0) 99 99 # define VBOX_SKB_KMAP_FRAG(frag) kmap_atomic(skb_frag_page(frag)) 100 100 # define VBOX_SKB_KUNMAP_FRAG(vaddr) kunmap_atomic(vaddr) 101 101 #else 102 # if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2,0)102 # if RTLNX_VER_MIN(3,2,0) 103 103 # define VBOX_SKB_KMAP_FRAG(frag) kmap_atomic(skb_frag_page(frag), KM_SKB_DATA_SOFTIRQ) 104 104 # define VBOX_SKB_KUNMAP_FRAG(vaddr) kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ) … … 109 109 #endif 110 110 111 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,34)111 #if RTLNX_VER_MIN(2,6,34) 112 112 # define VBOX_NETDEV_NAME(dev) netdev_name(dev) 113 113 #else … … 115 115 #endif 116 116 117 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,25)117 #if RTLNX_VER_MIN(2,6,25) 118 118 # define VBOX_IPV4_IS_LOOPBACK(addr) ipv4_is_loopback(addr) 119 119 # define VBOX_IPV4_IS_LINKLOCAL_169(addr) ipv4_is_linklocal_169(addr) … … 123 123 #endif 124 124 125 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,22)125 #if RTLNX_VER_MIN(2,6,22) 126 126 # define VBOX_SKB_RESET_NETWORK_HDR(skb) skb_reset_network_header(skb) 127 127 # define VBOX_SKB_RESET_MAC_HDR(skb) skb_reset_mac_header(skb) … … 133 133 #endif 134 134 135 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,19)135 #if RTLNX_VER_MIN(2,6,19) 136 136 # define VBOX_SKB_CHECKSUM_HELP(skb) skb_checksum_help(skb) 137 137 #else 138 138 # define CHECKSUM_PARTIAL CHECKSUM_HW 139 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,10)139 # if RTLNX_VER_MIN(2,6,10) 140 140 # define VBOX_SKB_CHECKSUM_HELP(skb) skb_checksum_help(skb, 0) 141 141 # else 142 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,7)142 # if RTLNX_VER_MIN(2,6,7) 143 143 # define VBOX_SKB_CHECKSUM_HELP(skb) skb_checksum_help(&skb, 0) 144 144 # else … … 151 151 #endif 152 152 153 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20,0)153 #if RTLNX_VER_MIN(3,20,0) 154 154 # define VBOX_HAVE_SKB_VLAN 155 155 #else … … 177 177 #endif 178 178 179 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,18)179 #if RTLNX_VER_MIN(2,6,18) 180 180 181 181 /** Indicates that the linux kernel may send us GSO frames. */ … … 196 196 # define VBOXNETFLT_WITH_GSO_RECV 1 197 197 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) 201 201 /** This enables or disables handling of GSO frames coming from the wire (GRO). */ 202 202 # define VBOXNETFLT_WITH_GRO 1 … … 246 246 247 247 248 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,12) && defined(LOG_ENABLED)248 #if RTLNX_VER_MAX(2,6,12) && defined(LOG_ENABLED) 249 249 unsigned dev_get_flags(const struct net_device *dev) 250 250 { … … 262 262 return flags; 263 263 } 264 #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,12) */264 #endif /* RTLNX_VER_MAX(2,6,12) */ 265 265 266 266 … … 344 344 #ifdef VBOXNETFLT_WITH_HOST2WIRE_FILTER 345 345 346 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,29)346 # if RTLNX_VER_MAX(2,6,29) 347 347 348 348 # include <linux/ethtool.h> … … 352 352 # define OVR_XMIT pfnStartXmit 353 353 354 # else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,29) */354 # else /* RTLNX_VER_MIN(2,6,29) */ 355 355 356 356 typedef struct net_device_ops OVR_OPSTYPE; … … 358 358 # define OVR_XMIT pOrgOps->ndo_start_xmit 359 359 360 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,29) */360 # endif /* RTLNX_VER_MIN(2,6,29) */ 361 361 362 362 /** … … 379 379 /** Pointer to the original ops. */ 380 380 OVR_OPSTYPE const *pOrgOps; 381 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,29)381 # if RTLNX_VER_MAX(2,6,29) 382 382 /** Pointer to the original hard_start_xmit function. */ 383 383 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) */ 385 385 /** Pointer to the net filter instance. */ 386 386 PVBOXNETFLTINS pVBoxNetFlt; … … 419 419 if ( !VALID_PTR(pOverride) 420 420 || pOverride->u32Magic != VBOXNETDEVICEOPSOVERRIDE_MAGIC 421 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,29)421 # if RTLNX_VER_MIN(2,6,29) 422 422 || !VALID_PTR(pOverride->pOrgOps) 423 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,29) */423 # endif /* RTLNX_VER_MIN(2,6,29) */ 424 424 ) 425 425 { … … 479 479 pOverride->pOrgOps = pDev->OVR_OPS; 480 480 pOverride->Ops = *pDev->OVR_OPS; 481 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,29)481 # if RTLNX_VER_MAX(2,6,29) 482 482 pOverride->pfnStartXmit = pDev->hard_start_xmit; 483 # else /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,29) */483 # else /* RTLNX_VER_MIN(2,6,29) */ 484 484 pOverride->Ops.ndo_start_xmit = vboxNetFltLinuxStartXmitFilter; 485 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,29) */485 # endif /* RTLNX_VER_MIN(2,6,29) */ 486 486 pOverride->u32Magic = VBOXNETDEVICEOPSOVERRIDE_MAGIC; 487 487 pOverride->cTotal = 0; … … 491 491 RTSpinlockAcquire(pThis->hSpinlock); /* (this isn't necessary, but so what) */ 492 492 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) 494 494 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) */ 496 496 RTSpinlockRelease(pThis->hSpinlock); 497 497 } … … 519 519 ) 520 520 { 521 # if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,29)521 # if RTLNX_VER_MAX(2,6,29) 522 522 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) */ 524 524 ASMAtomicWritePtr((void const * volatile *)&pDev->OVR_OPS, pOverride->pOrgOps); 525 525 ASMAtomicWriteU32(&pOverride->u32Magic, 0); … … 566 566 Log(("vboxNetFltLinuxRetainNetDev: Device %p(%s) retained. ref=%d\n", 567 567 pDev, pDev->name, 568 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,37)568 #if RTLNX_VER_MIN(2,6,37) 569 569 netdev_refcnt_read(pDev) 570 570 #else … … 602 602 Log(("vboxNetFltLinuxReleaseNetDev: Device %p(%s) released. ref=%d\n", 603 603 pDev, pDev->name, 604 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,37)604 #if RTLNX_VER_MIN(2,6,37) 605 605 netdev_refcnt_read(pDev) 606 606 #else … … 773 773 Assert(skb_headlen(pPkt) >= pSG->GsoCtx.cbHdrsTotal); 774 774 pPkt->ip_summed = CHECKSUM_PARTIAL; 775 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,22)775 # if RTLNX_VER_MIN(2,6,22) 776 776 pPkt->csum_start = skb_headroom(pPkt) + pSG->GsoCtx.offHdr2; 777 777 if (fGsoType & (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)) … … 817 817 DECLINLINE(unsigned) vboxNetFltLinuxGetChecksumStartOffset(struct sk_buff *pBuf) 818 818 { 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 820 824 unsigned char *pTransportHdr = pBuf->h.raw; 821 # if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)825 # if RTLNX_VER_MAX(2,6,19) 822 826 /* 823 827 * Try to work around the problem with CentOS 4.7 and 5.2 (2.6.9 … … 828 832 if (pBuf->h.raw == pBuf->nh.raw && pBuf->protocol == htons(ETH_P_IP)) 829 833 pTransportHdr = pBuf->nh.raw + pBuf->nh.iph->ihl * 4; 830 # endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */834 # endif 831 835 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 839 837 } 840 838 … … 867 865 unsigned cbProduced = 0; 868 866 869 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,27)867 # if RTLNX_VER_MIN(2,6,27) 870 868 /* Restore VLAN tag stripped by host hardware */ 871 869 if (vlan_tx_tag_present(pBuf)) … … 882 880 cbProduced += VLAN_ETH_HLEN; 883 881 } 884 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,27) */882 # endif /* RTLNX_VER_MIN(2,6,27) */ 885 883 886 884 if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING) … … 931 929 { 932 930 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) 934 932 pSG->aSegs[iSeg].cb = pFrag->bv_len; 935 933 pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset; … … 952 950 { 953 951 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) 955 953 pSG->aSegs[iSeg].cb = pFrag->bv_len; 956 954 pSG->aSegs[iSeg].pv = VBOX_SKB_KMAP_FRAG(pFrag) + pFrag->bv_offset; … … 1027 1025 * @returns 0 or EJUSTRETURN - this is probably copy & pastry and thus wrong. 1028 1026 */ 1029 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,14)1027 #if RTLNX_VER_MIN(2,6,14) 1030 1028 static int vboxNetFltLinuxPacketHandler(struct sk_buff *pBuf, 1031 1029 struct net_device *pSkbDev, … … 1042 1040 LogFlow(("vboxNetFltLinuxPacketHandler: pBuf=%p pSkbDev=%p pPacketType=%p\n", 1043 1041 pBuf, pSkbDev, pPacketType)); 1044 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,18)1042 #if RTLNX_VER_MIN(2,6,18) 1045 1043 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", 1046 1044 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) 1048 1046 Log6(("vboxNetFltLinuxPacketHandler: packet dump follows:\n%.*Rhxd\n", pBuf->len-pBuf->data_len, skb_mac_header(pBuf))); 1049 1047 # endif … … 1102 1100 /* Somehow skb_copy ignores mac_len */ 1103 1101 pBuf->mac_len = uMacLen; 1104 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,27)1102 # if RTLNX_VER_MIN(2,6,27) 1105 1103 /* Restore VLAN tag stripped by host hardware */ 1106 1104 if (vlan_tx_tag_present(pBuf) && skb_headroom(pBuf) >= VLAN_ETH_HLEN) … … 1114 1112 pBuf->mac_len += VLAN_HLEN; 1115 1113 } 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) 1119 1117 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", 1120 1118 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) 1122 1120 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) */ 1125 1123 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", 1126 1124 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) */ 1128 1126 } 1129 1127 #endif /* !VBOXNETFLT_SG_SUPPORT */ … … 1162 1160 *pcbTemp = vboxNetFltLinuxGetChecksumStartOffset(pBuf) + VBOX_SKB_CSUM_OFFSET(pBuf) + sizeof(uint16_t); 1163 1161 } 1164 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,27)1162 # if RTLNX_VER_MIN(2,6,27) 1165 1163 if (vlan_tx_tag_present(pBuf)) 1166 1164 { … … 1170 1168 *pcbTemp = VLAN_ETH_HLEN; 1171 1169 } 1172 # endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,27) */1170 # endif /* RTLNX_VER_MIN(2,6,27) */ 1173 1171 if (*pcbTemp) 1174 1172 ++cSegs; … … 1554 1552 * skb_gso_segment does the following. Do we need to do it as well? 1555 1553 */ 1556 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,22)1554 # if RTLNX_VER_MIN(2,6,22) 1557 1555 skb_reset_mac_header(pBuf); 1558 1556 pBuf->mac_len = pBuf->network_header - pBuf->mac_header; … … 1604 1602 if (pBuf->ip_summed == CHECKSUM_PARTIAL && pBuf->pkt_type == PACKET_OUTGOING) 1605 1603 { 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 1607 1607 /* 1608 1608 * Try to work around the problem with CentOS 4.7 and 5.2 (2.6.9 … … 1614 1614 if (pBuf->h.raw == pBuf->nh.raw && pBuf->protocol == htons(ETH_P_IP)) 1615 1615 pBuf->h.raw = pBuf->nh.raw + pBuf->nh.iph->ihl * 4; 1616 #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */1617 1616 int rc = VBOX_SKB_CHECKSUM_HELP(pBuf); 1618 #if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18)1619 1617 /* Restore the original (wrong) pointer. */ 1620 1618 pBuf->h.raw = tmp; 1621 #endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 18) */ 1622 if (rc) { 1619 # endif 1620 if (rc) 1621 { 1623 1622 LogRel(("VBoxNetFlt: Failed to compute checksum, dropping the packet.\n")); 1624 1623 return; … … 1674 1673 * @param pWork The work queue. 1675 1674 */ 1676 # if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,20)1675 # if RTLNX_VER_MIN(2,6,20) 1677 1676 static void vboxNetFltLinuxXmitTask(struct work_struct *pWork) 1678 1677 # else … … 1791 1790 return true; 1792 1791 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 */ 1794 1793 return !strncmp(Info.driver, "tun", 4) 1795 1794 && !strncmp(Info.bus_info, "tap", 4); … … 1800 1799 } 1801 1800 1802 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6,18)1801 #if RTLNX_VER_MAX(2,6,18) 1803 1802 DECLINLINE(void) netif_tx_lock_bh(struct net_device *pDev) 1804 1803 { … … 1853 1852 Log(("vboxNetFltLinuxAttachToInterface: Device %p(%s) retained. ref=%d\n", 1854 1853 pDev, pDev->name, 1855 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,37)1854 #if RTLNX_VER_MIN(2,6,37) 1856 1855 netdev_refcnt_read(pDev) 1857 1856 #else … … 1950 1949 Log(("vboxNetFltLinuxUnregisterDevice: Device %p(%s) released. ref=%d\n", 1951 1950 pDev, pDev->name, 1952 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,37)1951 #if RTLNX_VER_MIN(2,6,37) 1953 1952 netdev_refcnt_read(pDev) 1954 1953 #else … … 2061 2060 if (ulEventType == NETDEV_REGISTER) 2062 2061 { 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) 2065 2064 # define VBOX_DEV_NET(dev) dev_net(dev) 2066 2065 # define VBOX_NET_EQ(n1, n2) net_eq((n1), (n2)) … … 2133 2132 * IPv4 2134 2133 */ 2135 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,14)2134 #if RTLNX_VER_MIN(2,6,14) 2136 2135 in_dev = __in_dev_get_rtnl(dev); 2137 2136 #else … … 2168 2167 2169 2168 read_lock_bh(&in6_dev->lock); 2170 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,35)2169 #if RTLNX_VER_MIN(2,6,35) 2171 2170 list_for_each_entry(ifa, &in6_dev->addr_list, if_list) 2172 2171 #else … … 2472 2471 Log(("vboxNetFltOsDeleteInstance: Device %p(%s) released. ref=%d\n", 2473 2472 pDev, pDev->name, 2474 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6,37)2473 #if RTLNX_VER_MIN(2,6,37) 2475 2474 netdev_refcnt_read(pDev) 2476 2475 #else … … 2574 2573 #ifndef VBOXNETFLT_LINUX_NO_XMIT_QUEUE 2575 2574 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) 2577 2576 INIT_WORK(&pThis->u.s.XmitTask, vboxNetFltLinuxXmitTask); 2578 2577 # else -
trunk/src/VBox/HostDrivers/VBoxNetFlt/linux/files_vboxnetflt
r82968 r85698 65 65 ${PATH_ROOT}/include/iprt/utf16.h=>include/iprt/utf16.h \ 66 66 ${PATH_ROOT}/include/iprt/uuid.h=>include/iprt/uuid.h \ 67 ${PATH_ROOT}/include/iprt/linux/version.h=>include/iprt/linux/version.h \ 67 68 ${PATH_ROOT}/include/iprt/nocrt/limits.h=>include/iprt/nocrt/limits.h \ 68 69 ${PATH_ROOT}/include/VBox/cdefs.h=>include/VBox/cdefs.h \
Note:
See TracChangeset
for help on using the changeset viewer.