From 61240f45b0e2d09e251dbd4176a151964e98f696 Mon Sep 17 00:00:00 2001 From: Nils Juenemann Date: Tue, 21 Mar 2017 20:03:24 +0100 Subject: Fix for gobgp global rib --- table/table.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/table/table.go b/table/table.go index c3b48812..486f0894 100644 --- a/table/table.go +++ b/table/table.go @@ -387,7 +387,11 @@ func (t *Table) Select(option ...TableSelectOption) (*Table, error) { masklen = 128 } for i := masklen; i > 0; i-- { - if f(fmt.Sprintf("%s/%d", key, i)) { + _, prefix, err := net.ParseCIDR(fmt.Sprintf("%s/%d", key, i)) + if err != nil { + return nil, err + } + if f(prefix.String()) { break } } -- cgit v1.2.3