mirror of
https://github.com/alice-lg/alice-lg.git
synced 2024-05-11 05:55:03 +00:00
Merge pull request #84 from Netnod/fix-issue-83-Erroneous-peer-description
Fix issue #83 and implement peer description comming from openbgpd
This commit is contained in:
@ -57,9 +57,14 @@ func decodeNeighbor(n interface{}) (*api.Neighbour, error) {
|
||||
|
||||
// describeNeighbor creates a neighbor description
|
||||
func describeNeighbor(nb interface{}) string {
|
||||
addr := decoders.MapGetString(nb, "remote_addr", "invalid_address")
|
||||
asn := decoders.MapGetString(nb, "remote_as", "")
|
||||
return fmt.Sprintf("PEER AS%s %s", asn, addr)
|
||||
desc := decoders.MapGetString(nb, "description", "")
|
||||
if desc != "" {
|
||||
return desc
|
||||
} else {
|
||||
addr := decoders.MapGetString(nb, "remote_addr", "invalid_address")
|
||||
asn := decoders.MapGetString(nb, "remote_as", "")
|
||||
return fmt.Sprintf("PEER AS%s %s", asn, addr)
|
||||
}
|
||||
}
|
||||
|
||||
// decodeNeighbors retrievs neighbors data from
|
||||
|
Reference in New Issue
Block a user