Skip to content

Commit 7e0aa60

Browse files
committed
Fix missing mutex lock for updateBridgePMTUDFlowCache
Signed-off-by: Jaime Caamaño Ruiz <[email protected]>
1 parent c57e83c commit 7e0aa60

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

go-controller/pkg/node/openflow_manager.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,15 @@ func (c *openflowManager) Run(stopChan <-chan struct{}, doneWg *sync.WaitGroup)
211211
}
212212

213213
func (c *openflowManager) updateBridgePMTUDFlowCache(key string, ipAddrs []string) {
214+
// protect defaultBridge config from being updated by gw.nodeIPManager
215+
c.defaultBridge.Lock()
216+
defer c.defaultBridge.Unlock()
217+
214218
dftFlows := pmtudDropFlows(c.defaultBridge, ipAddrs)
215219
c.updateFlowCacheEntry(key, dftFlows)
216220
if c.externalGatewayBridge != nil {
221+
c.externalGatewayBridge.Lock()
222+
defer c.externalGatewayBridge.Unlock()
217223
exGWBridgeDftFlows := pmtudDropFlows(c.externalGatewayBridge, ipAddrs)
218224
c.updateExBridgeFlowCacheEntry(key, exGWBridgeDftFlows)
219225
}

0 commit comments

Comments
 (0)