summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-09-01 17:33:38 +0900
committerHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-09-01 19:52:55 +0900
commit78e2f93e2fddf86596880c1785bf67a861f1328d (patch)
treebcbf3de43d70ae0f160fc32cc9f9479d625e9a5b
parent459e5957f2450f6833f1314d782b144ad6289aca (diff)
zebra: use original nexthop
Signed-off-by: Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>
-rw-r--r--server/zclient.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/server/zclient.go b/server/zclient.go
index 48485242..7a1a2cb5 100644
--- a/server/zclient.go
+++ b/server/zclient.go
@@ -108,6 +108,7 @@ func createPathFromIPRouteMessage(m *zebra.Message, peerInfo *table.PeerInfo) *t
"Prefix": body.Prefix,
"PrefixLength": body.PrefixLength,
"Nexthop": body.Nexthops,
+ "IfIndex": body.Ifindexs,
"Metric": body.Metric,
"Distance": body.Distance,
"api": header.Command.String(),
@@ -115,11 +116,11 @@ func createPathFromIPRouteMessage(m *zebra.Message, peerInfo *table.PeerInfo) *t
if isV4 {
nlri = bgp.NewNLRInfo(body.PrefixLength, body.Prefix.String())
- nexthop := bgp.NewPathAttributeNextHop("0.0.0.0")
+ nexthop := bgp.NewPathAttributeNextHop(body.Nexthops[0].String())
pattr = append(pattr, nexthop)
} else {
nlri = bgp.NewIPv6AddrPrefix(body.PrefixLength, body.Prefix.String())
- mpnlri = bgp.NewPathAttributeMpReachNLRI("::", []bgp.AddrPrefixInterface{nlri})
+ mpnlri = bgp.NewPathAttributeMpReachNLRI(body.Nexthops[0].String(), []bgp.AddrPrefixInterface{nlri})
pattr = append(pattr, mpnlri)
}
@@ -156,7 +157,7 @@ func handleZapiMsg(msg *zebra.Message, server *BgpServer) []*SenderMsg {
if b.Prefix != nil && len(b.Nexthops) > 0 && b.Type != zebra.ROUTE_KERNEL {
p := createPathFromIPRouteMessage(msg, pi)
- msgs := server.propagateUpdate("", false, []*table.Path{p})
+ msgs := server.propagateUpdate(nil, []*table.Path{p})
return msgs
}
}