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

[yang] Change asn to start from 0 for bgp monitor #15350

Merged
merged 3 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@
"BGP_MONITORS": {
"5.6.7.8": {
"admin_status": "up",
"asn": "65000",
"asn": "0",
"holdtime": "180",
"keepalive": "60",
"local_addr": "10.0.0.11",
Expand Down
2 changes: 1 addition & 1 deletion src/sonic-yang-models/yang-models/sonic-bgp-common.yang
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ module sonic-bgp-common {
grouping sonic-bgp-cmn-neigh {
leaf asn {
type uint32 {
range "1..4294967295";
range "0..4294967295";
}
description "Peer AS number";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ module sonic-bgp-internal-neighbor {
must "(current() = /dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:bgp_asn)" {
error-message "Internal iBGP neighbors should have same ASN as defined in device metadata";
}
must ". >= 1" {
error-message "ASN must be greater than 0";
}
}
refine local_addr {
mandatory true;
Expand Down
8 changes: 7 additions & 1 deletion src/sonic-yang-models/yang-models/sonic-bgp-neighbor.yang
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,13 @@ module sonic-bgp-neighbor {
description "BGP Neighbor address";
}

uses bgpcmn:sonic-bgp-cmn-neigh;
uses bgpcmn:sonic-bgp-cmn-neigh {
refine asn {
must ". >= 1" {
error-message "ASN must be greater than 0";
}
}
}
}

list BGP_NEIGHBOR_LIST {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ module sonic-bgp-voq-chassis-neighbor {
must "(current() = /dm:sonic-device_metadata/dm:DEVICE_METADATA/dm:localhost/dm:bgp_asn)" {
error-message "Voq chassis BGP neighbors should have same ASN as defined in device metadata";
}
must ". >= 1" {
error-message "ASN must be greater than 0";
}
}
refine local_addr {
mandatory true;
Expand Down