summaryrefslogtreecommitdiffhomepage
path: root/table/table.go
diff options
context:
space:
mode:
Diffstat (limited to 'table/table.go')
-rw-r--r--table/table.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/table/table.go b/table/table.go
index 656f132c..28799a24 100644
--- a/table/table.go
+++ b/table/table.go
@@ -56,7 +56,10 @@ func NewTableDefault(scope_id int) *TableDefault {
}
func cidr2prefix(cidr string) patricia.Prefix {
- _, n, _ := net.ParseCIDR(cidr)
+ _, n, err := net.ParseCIDR(cidr)
+ if err != nil {
+ return patricia.Prefix(cidr)
+ }
var buffer bytes.Buffer
for i := 0; i < len(n.IP); i++ {
buffer.WriteString(fmt.Sprintf("%08b", n.IP[i]))