From 2b60347cfd5bfc48303aba038a18770f006ff7a6 Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Mon, 11 Apr 2016 10:13:30 +0000 Subject: path: improve Path.String() Signed-off-by: ISHIDA Wataru --- table/path.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'table/path.go') diff --git a/table/path.go b/table/path.go index 397bfbdd..48712610 100644 --- a/table/path.go +++ b/table/path.go @@ -506,6 +506,10 @@ func (path *Path) delPathAttr(typ bgp.BGPAttrType) { // return Path's string representation func (path *Path) String() string { s := bytes.NewBuffer(make([]byte, 0, 64)) + if path.IsEOR() { + s.WriteString(fmt.Sprintf("{ %s EOR | src: %s }", path.GetRouteFamily(), path.GetSource())) + return s.String() + } s.WriteString(fmt.Sprintf("{ %s | ", path.getPrefix())) s.WriteString(fmt.Sprintf("src: %s", path.GetSource())) s.WriteString(fmt.Sprintf(", nh: %s", path.GetNexthop())) -- cgit v1.2.3