Changeset 13787 in vbox
- Timestamp:
- Nov 4, 2008 3:22:17 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/solaris/VBoxNetFlt-solaris.c
r13769 r13787 2139 2139 2140 2140 /** 2141 * Wrapper for attaching our module to the specificed stream on the host stack.2142 * As a side-effect, the streams also gets opened/closed during the actual injection/ejection phase.2143 *2144 * @returns VBox status code.2145 * @param pThis The instance.2146 * @param fAttach Is this an attach or detach.2147 * @param StreamType Identifies the host stream the module be inject/ejected.2148 */2149 static int vboxNetFltSolarisModSetup(PVBOXNETFLTINS pThis, bool fAttach, VBOXNETFLTSTREAMTYPE StreamType)2150 {2151 LogFlow(("vboxNetFltSolarisModSetup: pThis=%p (%s) fAttach=%s StreamType=%d\n", pThis, pThis->szName,2152 fAttach ? "true" : "false", StreamType));2153 2154 switch (StreamType)2155 {2156 case kIp4Stream:2157 case kArpStream:2158 return vboxNetFltSolarisAttachIp4(pThis, fAttach);2159 2160 case kIp6Stream:2161 return vboxNetFltSolarisAttachIp6(pThis, fAttach);2162 2163 default:2164 LogRel((DEVICE_NAME ":vboxNetFltSolarisModSetup: Invalid stream type %d\n", StreamType));2165 return VERR_INTNET_FLT_IF_FAILED;2166 }2167 }2168 2169 2170 2171 /**2172 2141 * Wrapper for attaching ourselves to the interface. 2173 2142 * … … 2182 2151 if (RT_SUCCESS(rc)) 2183 2152 { 2184 rc = vboxNetFltSolaris ModSetup(pThis, true, kIp4Stream);2153 rc = vboxNetFltSolarisAttachIp4(pThis, true /* fAttach */); 2185 2154 if (RT_SUCCESS(rc)) 2186 2155 { 2187 vboxNetFltSolaris ModSetup(pThis, true, kIp6Stream);2156 vboxNetFltSolarisAttachIp6(pThis, true /* fAttach */); 2188 2157 /* Ignore Ipv6 binding errors as it's optional. */ 2189 2158 … … 2214 2183 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true); 2215 2184 vboxNetFltSolarisCloseStream(pThis); 2216 int rc = vboxNetFltSolaris ModSetup(pThis, false, kIp4Stream);2185 int rc = vboxNetFltSolarisAttachIp4(pThis, false /* fAttach */); 2217 2186 if (pThis->u.s.pvIp6Stream) 2218 rc = vboxNetFltSolaris ModSetup(pThis, false, kIp6Stream);2187 rc = vboxNetFltSolarisAttachIp6(pThis, false /* fAttach */); 2219 2188 2220 2189 return rc; … … 3160 3129 { 3161 3130 #ifdef VBOXNETFLT_SOLARIS_USE_NETINFO 3131 /* 3132 * @todo try find a way for IPFilter to accept ethernet frames (currently silently drops them). 3133 */ 3162 3134 mblk_t *pMsg = vboxNetFltSolarisMBlkFromSG(pThis, pSG, fDst); 3163 3135 if (RT_LIKELY(pMsg)) 3164 3136 { 3137 PCRTNETETHERHDR pEthHdr = (PCRTNETETHERHDR)pMsg->b_rptr; 3138 unsigned uProtocol; 3139 if (pEthHdr->EtherType == RT_H2BE_U16(RTNET_ETHERTYPE_IPV6)) 3140 uProtocol = AF_INET6; 3141 else if (pEthHdr->EtherType == RT_H2BE_U16(RTNET_ETHERTYPE_IPV4)) 3142 uProtocol = AF_INET; 3143 3144 /* 3145 * Queue out using netinfo. 3146 */ 3165 3147 netstack_t *pNetStack = netstack_get_current(); 3166 3148 if (pNetStack) … … 3176 3158 InjectData.ni_physical = pInterface; 3177 3159 bzero(&InjectData.ni_addr, sizeof(InjectData.ni_addr)); 3178 InjectData.ni_addr.ss_family = AF_INET;3160 InjectData.ni_addr.ss_family = uProtocol; 3179 3161 3180 3162 /* … … 3233 3215 } 3234 3216 #endif 3235 3236 3217 } 3237 3218 … … 3295 3276 * Send messages up IPv6 stream. 3296 3277 */ 3297 3278 LogFlow((DEVICE_NAME ":vboxNetFltPortOsXmit INTNETTRUNKDIR_HOST IPv6\n")); 3298 3279 3299 3280 pMsg->b_rptr += sizeof(RTNETETHERHDR);
Note:
See TracChangeset
for help on using the changeset viewer.