Changeset 29464 in vbox
- Timestamp:
- May 14, 2010 11:46:15 AM (15 years ago)
- Location:
- trunk/src/VBox/HostDrivers/VBoxNetFlt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/VBoxNetFlt.c
r29150 r29464 870 870 #ifdef VBOXNETFLT_STATIC_CONFIG 871 871 Assert(vboxNetFltGetState(pThis) == kVBoxNetFltInsState_Unconnected); 872 /* INTNETTRUNKIFSTATE_DISCONNECTING means "not connected" here873 * we use the INTNETTRUNKIFSTATE_DISCONNECTING state for consistency of cases when trunk874 * was never connected and was connected and disconnected.875 * In the latter case we end up with INTNETTRUNKIFSTATE_DICONNECTING,876 * so use the same state for the former */877 Assert(pThis->enmTrunkState == INTNETTRUNKIFSTATE_DISCONNECTING);878 872 #else 879 873 Assert(vboxNetFltGetState(pThis) == kVBoxNetFltInsState_Initializing); 874 #endif 880 875 Assert(pThis->enmTrunkState == INTNETTRUNKIFSTATE_INACTIVE); 881 #endif882 876 883 877 /* … … 895 889 pThis->pSwitchPort = NULL; 896 890 897 #ifdef VBOXNETFLT_STATIC_CONFIG898 /* INTNETTRUNKIFSTATE_DISCONNECTING means "not connected" here899 * we use the INTNETTRUNKIFSTATE_DISCONNECTING state for consistency of cases when trunk900 * was never connected and was connected and disconnected.901 * In the latter case we end up with INTNETTRUNKIFSTATE_DISCONNECTING,902 * so use the same state for the former */903 Assert(pThis->enmTrunkState == INTNETTRUNKIFSTATE_DISCONNECTING);904 #else905 891 Assert(pThis->enmTrunkState == INTNETTRUNKIFSTATE_INACTIVE); 906 #endif907 892 return rc; 908 893 } … … 930 915 /* 931 916 * Allocate and initialize a new instance before requesting the mutex. 917 * Note! That in a static config we'll initialize the trunk state to 918 * disconnecting and flip it in vboxNetFltFactoryCreateAndConnect 919 * later on. This better reflext the state and it works better with 920 * assertions in the destruction path. 932 921 */ 933 922 int rc; … … 950 939 pNew->enmState = kVBoxNetFltInsState_Initializing; 951 940 #ifdef VBOXNETFLT_STATIC_CONFIG 952 /* for consistency of cases when trunk was never connected and was connected and disconnected.953 * In the latter case we end up with INTNETTRUNKIFSTATE_DISCONNECTING,954 * so use the same state for the former */955 941 pNew->enmTrunkState = INTNETTRUNKIFSTATE_DISCONNECTING; 956 942 #else … … 1205 1191 if (vboxNetFltGetState(pCur) == kVBoxNetFltInsState_Unconnected) 1206 1192 { 1193 pCur->enmTrunkState = INTNETTRUNKIFSTATE_INACTIVE; /** @todo protect me? */ 1207 1194 pCur->fDisablePromiscuous = !!(fFlags & INTNETTRUNKFACTORY_FLAG_NO_PROMISC); 1208 1195 rc = vboxNetFltConnectIt(pCur, pSwitchPort, ppIfPort); 1209 1196 if (RT_SUCCESS(rc)) 1210 1197 pCur = NULL; /* Don't release it, reference given to the caller. */ 1198 else 1199 pCur->enmTrunkState = INTNETTRUNKIFSTATE_DISCONNECTING; 1211 1200 } 1212 1201 else -
trunk/src/VBox/HostDrivers/VBoxNetFlt/win/VBoxNetFlt-win.c
r29108 r29464 3217 3217 } 3218 3218 3219 3220 /** 3221 * Report the MAC address, promiscuous mode setting, GSO capabilities and 3222 * no-preempt destinations to the internal network. 3223 * 3224 * Does nothing if we're not currently connected to an internal network. 3225 * 3226 * @param pThis The instance data. 3227 */ 3228 static void vboxNetFltWinReportStuff(PVBOXNETFLTINS pThis) 3229 { 3230 /** @todo Keep these up to date, esp. the promiscuous mode bit. */ 3231 if ( pThis->pSwitchPort 3232 && vboxNetFltTryRetainBusyNotDisconnected(pThis)) 3233 { 3234 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 3235 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, 3236 vboxNetFltWinIsPromiscuous2(pThis)); 3237 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, 3238 INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 3239 /** @todo We should be able to do pfnXmit at DISPATCH_LEVEL... */ 3240 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 3241 vboxNetFltRelease(pThis, true /*fBusy*/); 3242 } 3243 } 3244 3219 3245 /** 3220 3246 * Worker for vboxNetFltWinAttachToInterface. … … 3306 3332 3307 3333 /* 5. Report MAC address, promiscuousness and GSO capabilities. */ 3308 /** @todo Keep these up to date, esp. the promiscuous mode bit. */ 3309 if ( pThis->pSwitchPort 3310 && vboxNetFltTryRetainBusyNotDisconnected(pThis)) 3311 { 3312 pThis->pSwitchPort->pfnReportMacAddress(pThis->pSwitchPort, &pThis->u.s.MacAddr); 3313 pThis->pSwitchPort->pfnReportPromiscuousMode(pThis->pSwitchPort, 3314 vboxNetFltWinIsPromiscuous2(pThis)); 3315 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, 3316 INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 3317 /** @todo We should be able to do pfnXmit at DISPATCH_LEVEL... */ 3318 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 3319 vboxNetFltRelease(pThis, true /*fBusy*/); 3320 } 3334 vboxNetFltWinReportStuff(pThis); 3335 3321 3336 return; 3322 3337 } … … 3718 3733 vboxNetFltWinJobSynchExecAtPassive(vboxNetFltWinConnectItWorker, &Info); 3719 3734 3735 if (RT_SUCCESS(Info.Status)) 3736 vboxNetFltWinReportStuff(pThis); 3737 3720 3738 return Info.Status; 3721 3739 }
Note:
See TracChangeset
for help on using the changeset viewer.