From 5c5deac88845f71ca75d08a6f43574702a057853 Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Sun, 6 Oct 2019 21:58:18 +0900 Subject: table: use net.IPNet for roa instead of homegrown IPPrefix structure Signed-off-by: FUJITA Tomonori --- pkg/server/grpc_server.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pkg') diff --git a/pkg/server/grpc_server.go b/pkg/server/grpc_server.go index 3c7527b2..215a1866 100644 --- a/pkg/server/grpc_server.go +++ b/pkg/server/grpc_server.go @@ -1584,11 +1584,12 @@ func newRoaListFromTableStructList(origin []*table.ROA) []*api.Roa { for _, r := range origin { host, portStr, _ := net.SplitHostPort(r.Src) port, _ := strconv.ParseUint(portStr, 10, 32) + ones, _ := r.Network.Mask.Size() l = append(l, &api.Roa{ As: r.AS, Maxlen: uint32(r.MaxLen), - Prefixlen: uint32(r.Prefix.Length), - Prefix: r.Prefix.Prefix.String(), + Prefixlen: uint32(ones), + Prefix: r.Network.IP.String(), Conf: &api.RPKIConf{ Address: host, RemotePort: uint32(port), -- cgit v1.2.3