diff options
author | Alin Gabriel Serdean <aserdean@ovn.org> | 2019-02-27 16:03:03 +0200 |
---|---|---|
committer | Alin Gabriel Serdean <aserdean@ovn.org> | 2019-03-13 13:29:49 +0200 |
commit | 3cdf29c52d1033cf8cb2f8d6d46fae545ea13b7d (patch) | |
tree | a2cd0de84ce8281220d290a2d9bf2e60d58702b2 /datapath-windows/ovsext | |
parent | 07f6b71daada1e1d5966abccd61b04820190195a (diff) | |
download | openvswitch-3cdf29c52d1033cf8cb2f8d6d46fae545ea13b7d.tar.gz |
datapath-windows: Guard vport usage in user.c
When using a vport we need to guard its usage with the dispatch lock.
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Acked-by: Anand Kumar <kumaranand@vmware.com>
Acked-by: Sairam Venugopal <vsairam@vmware.com>
Diffstat (limited to 'datapath-windows/ovsext')
-rw-r--r-- | datapath-windows/ovsext/User.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c index b43d7cc04..ed1fcbea8 100644 --- a/datapath-windows/ovsext/User.c +++ b/datapath-windows/ovsext/User.c @@ -452,14 +452,6 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute) } fwdDetail = NET_BUFFER_LIST_SWITCH_FORWARDING_DETAIL(pNbl); - vport = OvsFindVportByPortNo(gOvsSwitchContext, execute->inPort); - if (vport) { - fwdDetail->SourcePortId = vport->portId; - fwdDetail->SourceNicIndex = vport->nicIndex; - } else { - fwdDetail->SourcePortId = NDIS_SWITCH_DEFAULT_PORT_ID; - fwdDetail->SourceNicIndex = 0; - } // XXX: Figure out if any of the other members of fwdDetail need to be set. status = OvsGetFlowMetadata(&key, execute->keyAttrs); @@ -502,6 +494,14 @@ OvsExecuteDpIoctl(OvsPacketExecute *execute) if (ndisStatus == NDIS_STATUS_SUCCESS) { NdisAcquireRWLockRead(gOvsSwitchContext->dispatchLock, &lockState, 0); + vport = OvsFindVportByPortNo(gOvsSwitchContext, execute->inPort); + if (vport) { + fwdDetail->SourcePortId = vport->portId; + fwdDetail->SourceNicIndex = vport->nicIndex; + } else { + fwdDetail->SourcePortId = NDIS_SWITCH_DEFAULT_PORT_ID; + fwdDetail->SourceNicIndex = 0; + } ndisStatus = OvsActionsExecute(gOvsSwitchContext, NULL, pNbl, vport ? vport->portNo : OVS_DPPORT_NUMBER_INVALID, |