diff options
-rwxr-xr-x | cli/gobgpcli | 6 | ||||
-rw-r--r-- | server/peer.go | 9 |
2 files changed, 5 insertions, 10 deletions
diff --git a/cli/gobgpcli b/cli/gobgpcli index f3cde90a..6dfded5f 100755 --- a/cli/gobgpcli +++ b/cli/gobgpcli @@ -339,11 +339,7 @@ class Show(object): self.show_routes(f, d["Paths"], True, True) elif self.args[2] == "adj-rib-in" or self.args[2] == "adj-rib-out": - rfs = ["RF_IPv4_UC", "RF_IPv6_UC"] - for rf in rfs: - if rf in r.json(): - paths = r.json()[rf] - self.show_routes(f, paths, False, timestamp) + self.show_routes(f, r.json(), False, timestamp) return 0 def show_routes(self, f, paths, showBest=False, timestamp=False): diff --git a/server/peer.go b/server/peer.go index 6677e0bc..8ff38191 100644 --- a/server/peer.go +++ b/server/peer.go @@ -312,19 +312,18 @@ func (peer *Peer) handleREST(restReq *api.RestRequest) { pathList := peer.adjRib.GetOutPathList(restReq.RouteFamily) peer.sendMessages(table.CreateUpdateMsgFromPaths(pathList)) case api.REQ_ADJ_RIB_IN, api.REQ_ADJ_RIB_OUT: - adjrib := make(map[string][]table.Path) rf := restReq.RouteFamily if restReq.RequestType == api.REQ_ADJ_RIB_IN { paths := peer.adjRib.GetInPathList(rf) - adjrib[rf.String()] = paths + j, _ := json.Marshal(paths) + result.Data = j log.Debugf("RouteFamily=%v adj-rib-in found : %d", rf.String(), len(paths)) } else { paths := peer.adjRib.GetOutPathList(rf) - adjrib[rf.String()] = paths + j, _ := json.Marshal(paths) + result.Data = j log.Debugf("RouteFamily=%v adj-rib-out found : %d", rf.String(), len(paths)) } - j, _ := json.Marshal(adjrib) - result.Data = j case api.REQ_NEIGHBOR_ENABLE, api.REQ_NEIGHBOR_DISABLE: r := make(map[string]string) if restReq.RequestType == api.REQ_NEIGHBOR_ENABLE { |