summaryrefslogtreecommitdiffhomepage
path: root/server/server.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-11 23:48:24 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-04-11 23:48:24 +0900
commit1151436f137e32ac5d5ce9592cada872f47f312b (patch)
tree85cf2e808cf4269dc016470baae6fd57ff0154d2 /server/server.go
parentd670ecd940c8da57b0e841542ba4b4c30bb26dfe (diff)
rpki: support re-validation for specific prefix
You can specify a prefix to be validated like: $gobgp rpki validate 10.0.0.0/24 Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'server/server.go')
-rw-r--r--server/server.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/server/server.go b/server/server.go
index 4d0088ad..1bfc5d51 100644
--- a/server/server.go
+++ b/server/server.go
@@ -2841,7 +2841,14 @@ func (server *BgpServer) handleModRpki(grpcReq *GrpcRequest) {
isMonitored := server.isRpkiMonitored()
for _, rf := range server.globalRib.GetRFlist() {
if t, ok := server.globalRib.Tables[rf]; ok {
- for _, dst := range t.GetDestinations() {
+ dsts := t.GetDestinations()
+ if arg.Prefix != "" {
+ _, prefix, _ := net.ParseCIDR(arg.Prefix)
+ if dst := t.GetDestination(prefix.String()); dst != nil {
+ dsts = map[string]*table.Destination{prefix.String(): dst}
+ }
+ }
+ for _, dst := range dsts {
if rr := server.roaManager.validate(dst.GetAllKnownPathList(), isMonitored); isMonitored {
send := make([]*api.ROAResult, 0, len(rr))
for _, r := range rr {