From 25438b289c9c37a6f6a067b087836b979025e611 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Sun, 8 Sep 2019 22:43:08 +0900 Subject: execute rpki validation for policy only when it's necessary currently, validate is executed even if the result is not necessary. Signed-off-by: FUJITA Tomonori --- internal/pkg/table/policy.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'internal') diff --git a/internal/pkg/table/policy.go b/internal/pkg/table/policy.go index bffc01c0..24eda345 100644 --- a/internal/pkg/table/policy.go +++ b/internal/pkg/table/policy.go @@ -35,9 +35,9 @@ import ( ) type PolicyOptions struct { - Info *PeerInfo - ValidationResult *Validation - OldNextHop net.IP + Info *PeerInfo + OldNextHop net.IP + Validate func(*Path) *Validation } type DefinedType int @@ -1905,8 +1905,8 @@ func (c *RpkiValidationCondition) Type() ConditionType { } func (c *RpkiValidationCondition) Evaluate(path *Path, options *PolicyOptions) bool { - if options != nil && options.ValidationResult != nil { - return c.result == options.ValidationResult.Status + if options != nil && options.Validate != nil { + return c.result == options.Validate(path).Status } return false } -- cgit v1.2.3