Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit b36baf4

Browse files
committed
Delete fastdp bridge MACs when invalidating routes
The absence of the deletion might lead to installation of invalid flows, because the fastdp bridge MAC cache can have stale entries which are used when deciding when/what flows to create.
1 parent a610fce commit b36baf4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

router/fastdp.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,20 @@ func (fastdp fastDatapathOverlay) InvalidateRoutes() {
302302
log.Debug("InvalidateRoutes")
303303
fastdp.lock.Lock()
304304
defer fastdp.lock.Unlock()
305-
checkWarn(fastdp.deleteFlows())
305+
fastdp.deleteFlowsAndMACs()
306306
}
307307

308308
func (fastdp fastDatapathOverlay) InvalidateShortIDs() {
309309
log.Debug("InvalidateShortIDs")
310310
fastdp.lock.Lock()
311311
defer fastdp.lock.Unlock()
312+
fastdp.deleteFlowsAndMACs()
313+
}
314+
315+
// NB: The fastdp lock has to be taken before calling.
316+
func (fastdp *FastDatapath) deleteFlowsAndMACs() {
317+
fastdp.sendToMAC = make(map[MAC]bridgeSender)
318+
fastdp.seenMACs = make(map[MAC]struct{})
312319
checkWarn(fastdp.deleteFlows())
313320
}
314321

@@ -1023,7 +1030,7 @@ func (fastdp *FastDatapath) makeBridgeVport(vport odp.Vport) {
10231030

10241031
// Delete flows, in order to recalculate flows for broadcasts
10251032
// on the bridge.
1026-
checkWarn(fastdp.deleteFlows())
1033+
fastdp.deleteFlowsAndMACs()
10271034

10281035
// Packets coming from the netdev are processed by the bridge
10291036
fastdp.missHandlers[vportID] = func(flowKeys odp.FlowKeys, lock *fastDatapathLock) FlowOp {

0 commit comments

Comments
 (0)