Changeset 32773 in vbox
- Timestamp:
- Sep 27, 2010 12:43:41 PM (14 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxNetFlt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/Makefile.kmk
r32183 r32773 324 324 $(PATH_SUB_CURRENT) 325 325 vboxnetflt_LDFLAGS.solaris += -N drv/vboxdrv 326 ifdef VBOXNETFLT_SOLARIS_USE_NETINFO327 vboxnetflt_DEFS.solaris += VBOXNETFLT_SOLARIS_USE_NETINFO328 vboxnetflt_LDFLAGS.solaris += -N misc/neti329 endif330 326 vboxnetflt_LIBS = \ 331 327 $(PATH_LIB)/SUPR0IdcClient$(VBOX_SUFF_LIB) -
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r32716 r32773 65 65 #include <sys/sunddi.h> 66 66 #include <sys/sunldi.h> 67 68 /*69 * Experimental: Using netinfo interfaces and queuing out packets.70 * This is for playing better with IPFilter.71 */72 #undef VBOXNETFLT_SOLARIS_USE_NETINFO73 #ifdef VBOXNETFLT_SOLARIS_USE_NETINFO74 # include <sys/neti.h>75 #endif76 67 77 68 // Workaround for very strange define in sys/user.h … … 3839 3830 if (fDst & INTNETTRUNKDIR_WIRE) 3840 3831 { 3841 #ifdef VBOXNETFLT_SOLARIS_USE_NETINFO3842 /*3843 * @todo try find a way for IPFilter to accept ethernet frames (currently silently drops them).3844 */3845 mblk_t *pMsg = vboxNetFltSolarisMBlkFromSG(pThis, pSG, fDst);3846 if (RT_LIKELY(pMsg))3847 {3848 PCRTNETETHERHDR pEthHdr = (PCRTNETETHERHDR)pMsg->b_rptr;3849 unsigned uProtocol;3850 if (pEthHdr->EtherType == RT_H2BE_U16(RTNET_ETHERTYPE_IPV6))3851 uProtocol = AF_INET6;3852 else if (pEthHdr->EtherType == RT_H2BE_U16(RTNET_ETHERTYPE_IPV4))3853 uProtocol = AF_INET;3854 3855 /*3856 * Queue out using netinfo.3857 */3858 netstack_t *pNetStack = netstack_get_current();3859 if (pNetStack)3860 {3861 net_data_t pNetData = net_lookup_impl(NHF_INET, pNetStack);3862 if (pNetData)3863 {3864 phy_if_t pInterface = net_phylookup(pNetData, pThis->szName);3865 if (pInterface)3866 {3867 net_inject_t InjectData;3868 InjectData.ni_packet = pMsg;3869 InjectData.ni_physical = pInterface;3870 bzero(&InjectData.ni_addr, sizeof(InjectData.ni_addr));3871 InjectData.ni_addr.ss_family = uProtocol;3872 3873 /*3874 * Queue out rather than direct out transmission.3875 */3876 int rc = net_inject(pNetData, NI_QUEUE_OUT, &InjectData);3877 if (!rc)3878 rc = VINF_SUCCESS;3879 else3880 {3881 LogRel((DEVICE_NAME ":queuing IP packet for transmission failed. rc=%d\n", rc));3882 rc = VERR_NET_IO_ERROR;3883 }3884 }3885 else3886 {3887 LogRel((DEVICE_NAME ":vboxNetFltPortOsXmit failed to lookup physical interface.\n"));3888 rc = VERR_NET_IO_ERROR;3889 }3890 }3891 else3892 {3893 LogRel((DEVICE_NAME ":vboxNetFltPortOsXmit failed to get IP hooks.\n"));3894 rc = VERR_NET_IO_ERROR;3895 }3896 netstack_rele(pNetStack);3897 }3898 else3899 {3900 LogRel((DEVICE_NAME ":vboxNetFltPortOsXmit failed to get current net stack.\n"));3901 rc = VERR_NET_IO_ERROR;3902 }3903 }3904 else3905 {3906 LogRel((DEVICE_NAME ":vboxNetFltPortOsXmit vboxNetFltSolarisMBlkFromSG failed.\n"));3907 rc = VERR_NO_MEMORY;3908 }3909 #else3910 3832 vboxnetflt_promisc_stream_t *pPromiscStream = ASMAtomicUoReadPtrT(&pThis->u.s.pPromiscStream, vboxnetflt_promisc_stream_t *); 3911 3833 if (RT_LIKELY(pPromiscStream)) … … 3925 3847 } 3926 3848 } 3927 #endif3928 3849 } 3929 3850
Note:
See TracChangeset
for help on using the changeset viewer.