Skip to content
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

Merged
merged 3 commits into from
Jul 31, 2019

Conversation

lukedirtwalker
Copy link
Collaborator

@lukedirtwalker lukedirtwalker commented Jul 31, 2019

Filters paths with the given policy, using the policy's Act method.

Fixes #2821


This change is Reviewable

Filters paths with the given policy, using the policy's Act method.

Fixes scionproto#2821
Copy link
Contributor

@oncilla oncilla left a 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
}

Copy link
Collaborator Author

@lukedirtwalker lukedirtwalker left a 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.

Copy link
Contributor

@oncilla oncilla left a 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: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@oncilla oncilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

Copy link
Contributor

@oncilla oncilla left a 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: :shipit: complete! all files reviewed, all discussions resolved

@lukedirtwalker lukedirtwalker merged commit 19aa12d into scionproto:master Jul 31, 2019
@lukedirtwalker lukedirtwalker deleted the pubPolicyFilter branch July 31, 2019 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement module to filter paths with a given path policy
2 participants