From 6959a880021cbc8505c5224883bb535824b9bf9f Mon Sep 17 00:00:00 2001 From: Jarno Rajahalme Date: Wed, 2 Jun 2021 13:59:49 -0700 Subject: [PATCH] check: Expand flow results properly in Merge() Flow result may have FirstMatch but no LastMatch. When merging flow results extend the range or flows also in this case. Signed-off-by: Jarno Rajahalme --- connectivity/check/check.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/connectivity/check/check.go b/connectivity/check/check.go index 9b4e1895b3..94d5220772 100644 --- a/connectivity/check/check.go +++ b/connectivity/check/check.go @@ -107,6 +107,9 @@ func (r *FlowRequirementResults) Merge(from *FlowRequirementResults) { if r.FirstMatch < 0 || from.FirstMatch >= 0 && from.FirstMatch < r.FirstMatch { r.FirstMatch = from.FirstMatch } + if from.FirstMatch > r.LastMatch { + r.LastMatch = from.FirstMatch + } if from.LastMatch > r.LastMatch { r.LastMatch = from.LastMatch }