No reason to restrict Peer ASN's to private only. (#576)

* No reason to restrict Peer ASN's to private only. This change is to restrict to public and private ranges.

* gofmt
This commit is contained in:
rillion 2018-11-16 07:42:31 +02:00 committed by Murali Reddy
parent 4d6b7faaf9
commit c39c13b6cf

View File

@ -257,9 +257,12 @@ func newGlobalPeers(ips []net.IP, ports []uint16, asns []uint32, passwords []str
}
for i := 0; i < len(ips); i++ {
if !((asns[i] >= 64512 && asns[i] <= 65535) ||
if !((asns[i] >= 1 && asns[i] <= 23455) ||
(asns[i] >= 23457 && asns[i] <= 63999) ||
(asns[i] >= 64512 && asns[i] <= 65534) ||
(asns[i] >= 131072 && asns[i] <= 4199999999) ||
(asns[i] >= 4200000000 && asns[i] <= 4294967294)) {
return nil, fmt.Errorf("Invalid ASN number \"%d\" for global BGP peer",
return nil, fmt.Errorf("Reserved ASN number \"%d\" for global BGP peer",
asns[i])
}