-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sciond: Add method to filter paths with a policy #2945
sciond: Add method to filter paths with a policy #2945
Conversation
Filters paths with the given policy, using the policy's Act method. Fixes scionproto#2821
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lukedirtwalker)
go/lib/pathpol/acl.go, line 35 at r1 (raw file):
} lastRule := entries[len(entries)-1].Rule if lastRule != nil && (lastRule.IfIDs[0] != 0 || lastRule.ISD != 0 || lastRule.AS != 0) {
I suggest you make this a method on HopPredicate
:
func (hp *HopPredicate) matchesAll() bool {
if hp == nil {
return true
}
// hp.AS == 0 implies that there is exactly one 0 interfaces.
return hp.ISD == 0 && hp.AS == 0
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 6 files reviewed, 1 unresolved discussion (waiting on @oncilla)
go/lib/pathpol/acl.go, line 35 at r1 (raw file):
Previously, Oncilla wrote…
I suggest you make this a method on
HopPredicate
:func (hp *HopPredicate) matchesAll() bool { if hp == nil { return true } // hp.AS == 0 implies that there is exactly one 0 interfaces. return hp.ISD == 0 && hp.AS == 0 }
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 2 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3.
Reviewable status: complete! all files reviewed, all discussions resolved
Filters paths with the given policy, using the policy's Act method.
Fixes #2821
This change is