filter-as-set not working when only peer ASN is in the specified AS-set
Describe the bug
When filter-as-set is set to true, generation of the configuration fails with an error message of FATA[0001] peer has filter-as-set enabled but no members in it's as-set if only the peer's ASN is in the AS-set without any others present.
Environment
Pathvector 6.3.2
Built c35220bf121f366ff05a51d93c6236e8c324d682 on 2023-06-11T07:03:14Z
No plugins
BIRD: ready.
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
To Reproduce Steps to reproduce the behavior:
- Ensure the specified AS-set for a peer only contains said peer's ASN.
- Enable
filter-as-seton the peer's session configuration - Receive error of
FATA[0001] peer has filter-as-set enabled but no members in it's as-set
Expected behavior Generation succeeds without error
Partially resolved, filter-as-set also requires auto-as-set-members to be enabled to ensure it can fetch the AS-set members to filter on.
One thing I noticed is that the filter logic for filter-as-set only checks that the first ASN in the path, instead of the last ASN which is usually the originating ASN. I'm making a pull request now to fix this to ensure the function works as intended.