summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gobgp/cmd/rpki.go4
-rw-r--r--server/rpki.go5
2 files changed, 5 insertions, 4 deletions
diff --git a/gobgp/cmd/rpki.go b/gobgp/cmd/rpki.go
index 200b7b1d..b306f8a2 100644
--- a/gobgp/cmd/rpki.go
+++ b/gobgp/cmd/rpki.go
@@ -36,7 +36,7 @@ func showRPKIServer(args []string) error {
fmt.Println(err)
return err
}
- format := "%-18s %-6s %-10s %s\n"
+ format := "%-23s %-6s %-10s %s\n"
fmt.Printf(format, "Session", "State", "Uptime", "#IPv4/IPv6 records")
for {
r, err := stream.Recv()
@@ -52,7 +52,7 @@ func showRPKIServer(args []string) error {
uptime = fmt.Sprint(formatTimedelta(int64(time.Now().Sub(time.Unix(r.State.Uptime, 0)).Seconds())))
}
- fmt.Printf(format, fmt.Sprintf(r.Conf.Address), s, uptime, fmt.Sprintf("%d/%d", r.State.ReceivedIpv4, r.State.ReceivedIpv6))
+ fmt.Printf(format, net.JoinHostPort(r.Conf.Address, strconv.Itoa(int(r.Conf.RemotePort))), s, uptime, fmt.Sprintf("%d/%d", r.State.ReceivedIpv4, r.State.ReceivedIpv6))
}
return nil
}
diff --git a/server/rpki.go b/server/rpki.go
index 7fa9aea4..cbe6ad6b 100644
--- a/server/rpki.go
+++ b/server/rpki.go
@@ -267,10 +267,11 @@ func (c *roaManager) handleGRPC(grpcReq *GrpcRequest) {
for _, client := range c.clientMap {
state := client.state
received := &state.RpkiMessages.RpkiReceived
- addr, _ := splitHostPort(client.host)
+ addr, port := splitHostPort(client.host)
rpki := &api.RPKI{
Conf: &api.RPKIConf{
- Address: addr,
+ Address: addr,
+ RemotePort: uint32(port),
},
State: &api.RPKIState{
Uptime: state.Uptime,