summaryrefslogtreecommitdiffhomepage
path: root/table/table.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/table.go')
-rw-r--r--table/table.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/table/table.go b/table/table.go
index 6c5d4da8..6e90faf7 100644
--- a/table/table.go
+++ b/table/table.go
@@ -376,7 +376,7 @@ func (t *Table) Select(option ...TableSelectOption) (*Table, error) {
return nil, err
}
ones, _ := prefix.Mask.Size()
- for i := ones; i > 0; i-- {
+ for i := ones; i >= 0; i-- {
_, prefix, _ := net.ParseCIDR(fmt.Sprintf("%s/%d", addr.String(), i))
f(prefix.String())
}
@@ -386,7 +386,7 @@ func (t *Table) Select(option ...TableSelectOption) (*Table, error) {
if t.routeFamily == bgp.RF_IPv6_UC {
masklen = 128
}
- for i := masklen; i > 0; i-- {
+ for i := masklen; i >= 0; i-- {
_, prefix, err := net.ParseCIDR(fmt.Sprintf("%s/%d", key, i))
if err != nil {
return nil, err