From 257bdda69ad625fa036bad63accfca2419f784a3 Mon Sep 17 00:00:00 2001 From: 186526 Date: Tue, 27 Dec 2022 00:16:27 +0800 Subject: [PATCH] Fix: wrong use of filter --- lib/community-net186.conf | 4 ++-- lib/community-peer.conf | 4 ++-- lib/community-transit.conf | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/community-net186.conf b/lib/community-net186.conf index 82b5792..6064b65 100644 --- a/lib/community-net186.conf +++ b/lib/community-net186.conf @@ -1,4 +1,4 @@ -filter net186_import_filter(int POPID) +function net186_import_filter (int POPID) int viaRegion; bgppath public_bgp_path; { @@ -32,7 +32,7 @@ filter net186_import_filter(int POPID) bgp_local_pref = bgp_local_pref - filter(bgp_large_community, [(LOCAL_ASN, 122, *)]).len * 10; }; -filtet net186_export_filter(int POPID) { +function net186_export_filter (POPID) { if (65535, 65282) ~ bgp_community then { reject; } diff --git a/lib/community-peer.conf b/lib/community-peer.conf index 49b88a1..3bc8033 100644 --- a/lib/community-peer.conf +++ b/lib/community-peer.conf @@ -7,7 +7,7 @@ function is_peer_route() { return true; } -filter direct_peer_import_filter(int ASN) { +function direct_peer_import_filter(int ASN) { if !is_valid() then reject; pub_add_communities(ASN, 0); pub_preprocess_communities(); @@ -15,7 +15,7 @@ filter direct_peer_import_filter(int ASN) { accept; } -filter direct_peer_export_filter(int ASN) { +function direct_peer_export_filter(int ASN) { if !is_valid() then reject; # Delete Self eBGP Confed Path. bgp_path.delete([4200000000..4225479999]); diff --git a/lib/community-transit.conf b/lib/community-transit.conf index 2ebc0e7..8930e9e 100644 --- a/lib/community-transit.conf +++ b/lib/community-transit.conf @@ -1,4 +1,3 @@ - function pub_add_communities(int ASN, int type) { # DIRECT PEER @@ -76,14 +75,14 @@ function pub_process_communities(int ASN, int type) { } -filter transit_import_filter(int ASN) { +function transit_import_filter(int ASN) { if !is_valid() then reject; pub_add_communities(ASN, 10); pub_preprocess_communities(); accept; } -filter transit_export_filter(int ASN) { +function transit_export_filter(int ASN) { if !is_valid() then reject; # Delete Self eBGP Confed Path. bgp_path.delete([4200000000..4225479999]);