Fix: wrong use of filter

production
186526 2022-12-27 00:16:27 +08:00
parent 3c1b5f2d6a
commit 257bdda69a
3 changed files with 6 additions and 7 deletions

View File

@ -1,4 +1,4 @@
filter net186_import_filter(int POPID) function net186_import_filter (int POPID)
int viaRegion; int viaRegion;
bgppath public_bgp_path; 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; 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 { if (65535, 65282) ~ bgp_community then {
reject; reject;
} }

View File

@ -7,7 +7,7 @@ function is_peer_route() {
return true; return true;
} }
filter direct_peer_import_filter(int ASN) { function direct_peer_import_filter(int ASN) {
if !is_valid() then reject; if !is_valid() then reject;
pub_add_communities(ASN, 0); pub_add_communities(ASN, 0);
pub_preprocess_communities(); pub_preprocess_communities();
@ -15,7 +15,7 @@ filter direct_peer_import_filter(int ASN) {
accept; accept;
} }
filter direct_peer_export_filter(int ASN) { function direct_peer_export_filter(int ASN) {
if !is_valid() then reject; if !is_valid() then reject;
# Delete Self eBGP Confed Path. # Delete Self eBGP Confed Path.
bgp_path.delete([4200000000..4225479999]); bgp_path.delete([4200000000..4225479999]);

View File

@ -1,4 +1,3 @@
function pub_add_communities(int ASN, int type) { function pub_add_communities(int ASN, int type) {
# DIRECT PEER # 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; if !is_valid() then reject;
pub_add_communities(ASN, 10); pub_add_communities(ASN, 10);
pub_preprocess_communities(); pub_preprocess_communities();
accept; accept;
} }
filter transit_export_filter(int ASN) { function transit_export_filter(int ASN) {
if !is_valid() then reject; if !is_valid() then reject;
# Delete Self eBGP Confed Path. # Delete Self eBGP Confed Path.
bgp_path.delete([4200000000..4225479999]); bgp_path.delete([4200000000..4225479999]);