summaryrefslogtreecommitdiffhomepage
path: root/config/serve.go
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-07-15 19:53:53 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-31 16:26:17 +0900
commit0b4b806c06f0ee50bb1bc1b30c38399553687abd (patch)
tree6898ec9eeb21a26668012c1c7743772da7b72214 /config/serve.go
parent2ad42ead02cce21cf71b3dde0731e8f5c6d4ac6a (diff)
config: use the latest openconfig yang
Diffstat (limited to 'config/serve.go')
-rw-r--r--config/serve.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/config/serve.go b/config/serve.go
index 390229c1..74529a16 100644
--- a/config/serve.go
+++ b/config/serve.go
@@ -37,7 +37,7 @@ func ReadConfigfileServe(path string, configCh chan BgpConfigSet, reloadCh chan
func inSlice(n Neighbor, b []Neighbor) bool {
for _, nb := range b {
- if nb.NeighborAddress.String() == n.NeighborAddress.String() {
+ if nb.NeighborConfig.NeighborAddress.String() == n.NeighborConfig.NeighborAddress.String() {
return true
}
}
@@ -56,19 +56,19 @@ func UpdateConfig(curC *Bgp, newC *Bgp) (*Bgp, []Neighbor, []Neighbor) {
added := []Neighbor{}
deleted := []Neighbor{}
- for _, n := range newC.NeighborList {
- if inSlice(n, curC.NeighborList) == false {
+ for _, n := range newC.Neighbors.NeighborList {
+ if inSlice(n, curC.Neighbors.NeighborList) == false {
added = append(added, n)
}
}
- for _, n := range curC.NeighborList {
- if inSlice(n, newC.NeighborList) == false {
+ for _, n := range curC.Neighbors.NeighborList {
+ if inSlice(n, newC.Neighbors.NeighborList) == false {
deleted = append(deleted, n)
}
}
- bgpConfig.NeighborList = newC.NeighborList
+ bgpConfig.Neighbors.NeighborList = newC.Neighbors.NeighborList
return &bgpConfig, added, deleted
}