From 0ef14bb14bfb600957325cde65d59a650ff9bff1 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Thu, 23 Jun 2016 22:14:12 +0900 Subject: collector: fix withdraw update crash Withdraw message doesn't have ASPATH. Signed-off-by: FUJITA Tomonori --- server/collector.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'server') 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 := "-" -- cgit v1.2.3