Changeset 38370 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt
- Timestamp:
- Aug 9, 2011 8:37:03 AM (13 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxNetFlt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFltInternal.h
r38140 r38370 24 24 #include <iprt/assert.h> 25 25 26 /* Copied from VBoxNetAdp/VBoxNetAdpInternal.h */ 27 #define VBOXNETADP_MAGIC 0x56424e41 26 28 27 29 RT_C_DECLS_BEGIN -
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r33676 r38370 787 787 * @param fSrc Where the packet (allegedly) comes from, one INTNETTRUNKDIR_* value. 788 788 * @param eProtocol The protocol. 789 * @param pIfNet The network interface. 789 790 */ 790 791 static errno_t vboxNetFltDarwinIffInputOutputWorker(PVBOXNETFLTINS pThis, mbuf_t pMBuf, void *pvFrame, 791 uint32_t fSrc, protocol_family_t eProtocol) 792 uint32_t fSrc, protocol_family_t eProtocol, 793 ifnet_t pIfNet) 792 794 { 793 795 /* … … 838 840 fDropIt = pThis->pSwitchPort->pfnRecv(pThis->pSwitchPort, NULL /* pvIf */, pSG, fSrc); 839 841 if (fDropIt) 840 mbuf_freem(pMBuf); 842 { 843 /* 844 * Check is this interface belongs to vboxnetadp. We should not drop 845 * any packets before they get to vboxnetadp as it passes them to tap 846 * callbacks in order for BPF to work properly. 847 */ 848 uint32_t *pMagic = (uint32_t *)ifnet_softc(pIfNet); 849 Log2(("vboxnetflt: pMagic=%p *pMagic=%x\n", pMagic, pMagic ? *pMagic : -1)); 850 if (pMagic && *pMagic == VBOXNETADP_MAGIC) 851 fDropIt = false; 852 else 853 mbuf_freem(pMBuf); 854 } 841 855 } 842 856 … … 857 871 858 872 NOREF(eProtocol); 859 NOREF(pIfNet); 860 return vboxNetFltDarwinIffInputOutputWorker((PVBOXNETFLTINS)pvThis, *ppMBuf, NULL, INTNETTRUNKDIR_HOST, eProtocol); 873 return vboxNetFltDarwinIffInputOutputWorker((PVBOXNETFLTINS)pvThis, *ppMBuf, NULL, INTNETTRUNKDIR_HOST, eProtocol, pIfNet); 861 874 } 862 875 … … 870 883 { 871 884 NOREF(eProtocol); 872 NOREF(pIfNet); 873 return vboxNetFltDarwinIffInputOutputWorker((PVBOXNETFLTINS)pvThis, *ppMBuf, *ppchFrame, INTNETTRUNKDIR_WIRE, eProtocol); 885 return vboxNetFltDarwinIffInputOutputWorker((PVBOXNETFLTINS)pvThis, *ppMBuf, *ppchFrame, INTNETTRUNKDIR_WIRE, eProtocol, pIfNet); 874 886 } 875 887
Note:
See TracChangeset
for help on using the changeset viewer.