Skip to content

Commit

Permalink
fixed #421
Browse files Browse the repository at this point in the history
  • Loading branch information
IrineSistiana committed Jul 4, 2022
1 parent 48c2570 commit abcb222
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/matcher/netlist/load_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,7 @@ func LoadFromV2CIDR(l *List, cidr []*v2data.CIDR) error {
return fmt.Errorf("invalid ip data at index #%d: %s", i, e.Ip)
}

bits := e.Prefix
if len(e.Ip) == 4 {
bits += 96
}
prefix := netip.PrefixFrom(netip.AddrFrom16(ip.As16()), int(e.Prefix))
prefix := netip.PrefixFrom(ip, int(e.Prefix))
if !prefix.IsValid() {
return fmt.Errorf("invalid cidr data at index #%d: %s", i, e.String())
}
Expand Down

0 comments on commit abcb222

Please sign in to comment.