diff options
author | Satoshi Fujimoto <satoshi.fujimoto7@gmail.com> | 2017-06-13 14:04:50 +0900 |
---|---|---|
committer | Satoshi Fujimoto <satoshi.fujimoto7@gmail.com> | 2017-06-16 09:09:47 +0900 |
commit | be2524ee3e158a0d248d730f727da80bab09aed8 (patch) | |
tree | e27c107dc19f448bcfdd325f88cb27d82c406da4 /client/client.go | |
parent | 83684d5e62fb14596aabf03747a8b395543f91bb (diff) |
config: Use State to get NeighborAddress instead of Config
By introducing dynamic neighbor feature,
GoBGP can have dynamic neighbors,
and corresponding Config.NeighboAddress can be empty.
This patch sets State.NeighborAddress for all neighbors,
and gets the neighbor's address from them.
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
Diffstat (limited to 'client/client.go')
-rw-r--r-- | client/client.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/client/client.go b/client/client.go index 4a94ac4a..b9faf6ba 100644 --- a/client/client.go +++ b/client/client.go @@ -136,14 +136,14 @@ func (cli *Client) getNeighbor(name string, afi int, vrf string, enableAdvertise neighbors := make([]*config.Neighbor, 0, len(ret.Peers)) for _, p := range ret.Peers { - if name != "" && name != p.Conf.NeighborAddress && name != p.Conf.NeighborInterface { + if name != "" && name != p.Info.NeighborAddress && name != p.Conf.NeighborInterface { continue } if vrf != "" && name != p.Conf.Vrf { continue } if afi > 0 { - v6 := net.ParseIP(p.Conf.NeighborAddress).To4() == nil + v6 := net.ParseIP(p.Info.NeighborAddress).To4() == nil if afi == bgp.AFI_IP && v6 || afi == bgp.AFI_IP6 && !v6 { continue } |