summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-06-23 22:14:12 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-06-27 12:35:54 +0900
commit0ef14bb14bfb600957325cde65d59a650ff9bff1 (patch)
tree8ef2da83e1a44c2ebcce15506da35e776acce62d
parentc9e86a9416503f6b128bf3c0329c8f612525b919 (diff)
collector: fix withdraw update crash
Withdraw message doesn't have ASPATH. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
-rw-r--r--server/collector.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/collector.go b/server/collector.go
index e9039fde..72f820c0 100644
--- a/server/collector.go
+++ b/server/collector.go
@@ -92,7 +92,10 @@ func (c *Collector) writePeer(msg *watcherEventStateChangedMsg) error {
func path2data(path *table.Path) (map[string]interface{}, map[string]string) {
fields := map[string]interface{}{
- "ASPath": path.GetAsPath().String(),
+ "RouterID": path.GetSource().ID,
+ }
+ if asPath := path.GetAsPath(); asPath != nil {
+ fields["ASPath"] = asPath.String()
}
if origin, err := path.GetOrigin(); err == nil {
typ := "-"