summaryrefslogtreecommitdiffhomepage
path: root/table
diff options
context:
space:
mode:
Diffstat (limited to 'table')
-rw-r--r--table/table.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/table/table.go b/table/table.go
index 486f0894..6c5d4da8 100644
--- a/table/table.go
+++ b/table/table.go
@@ -371,13 +371,13 @@ func (t *Table) Select(option ...TableSelectOption) (*Table, error) {
}
}
case LOOKUP_SHORTER:
- _, prefix, err := net.ParseCIDR(key)
+ addr, prefix, err := net.ParseCIDR(key)
if err != nil {
return nil, err
}
- ones, bits := prefix.Mask.Size()
+ ones, _ := prefix.Mask.Size()
for i := ones; i > 0; i-- {
- prefix.Mask = net.CIDRMask(i, bits)
+ _, prefix, _ := net.ParseCIDR(fmt.Sprintf("%s/%d", addr.String(), i))
f(prefix.String())
}
default: