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

No error set on non-existing AS-SET #1

Open
afpd opened this issue Jan 10, 2020 · 3 comments
Open

No error set on non-existing AS-SET #1

afpd opened this issue Jan 10, 2020 · 3 comments

Comments

@afpd
Copy link

afpd commented Jan 10, 2020

$ ./bgpq4 -t -j AS-BOGUS
{"NN": [
]}
$ echo $?
0
Expected value should be non-zero

@lukastribus
Copy link

lukastribus commented Jan 10, 2020

No, an empty or non existing reference must not error out, otherwise people end up without filters in automated processes.

AS-MACRO's will also refer to non existing macro's or asns.

If in doubt --> don't allow anything. Not "allow everything".

@afpd
Copy link
Author

afpd commented Jan 10, 2020

Surely it should. How else one distinguish empty AS-SET from non-existent AS-SET?
Additionally different error code must be set for the top level non-existent AS-SET and included non-existent AS-SET.

@lukastribus
Copy link

lukastribus commented Jan 10, 2020

I disagree I think the only safe way to handle wrong references (direct or indirect) is to create filters that are actually usable in devices (so they actual work) and of course, should not contain anything that is not actually allowed.

If you return non-null and/or don't output the actual ACL, a partially deployed configuration can lead to:

  • a BGP configuration with a new customer ending up actually unfiltered (the worst thing that could happen if our goal is filtering)
  • an update with a existing peer/customer isn't actually updated, because some downstream ASN has made a wrong reference, causing the entire prefix-list update to abort (possibly unnoticed, and your direct customer or peer isn't actually directly responsible for it)

I think this is a little more complicated than "just adopting the unix philosophy " ....

How else one distinguish empty AS-SET from non-existent AS-SET?

You shouldn't imho, not when using bgpq4 in an non-interactive way, because it will cause more (possible a lot more) harm.

@job job transferred this issue from another repository Jan 18, 2020
job pushed a commit that referenced this issue Mar 5, 2023
…85)

* Fix issue #83 - fix regression bug which ignored -S CLI option (#1)

* Fix issue #83 - fix regression bug which ignored -S CLI option, introduced by commit 08b81f7
---------

Co-authored-by: James Bensley <[email protected]>

* Fix off-by-one error

* Swap strlcpy for strdup

---------

Co-authored-by: James Bensley <[email protected]>
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

No branches or pull requests

2 participants