Skip to content

Commit

Permalink
Fix ipv6 net.CIDRMask
Browse files Browse the repository at this point in the history
  • Loading branch information
aries15 authored Oct 30, 2022
1 parent e721cc8 commit f40e8a4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions header/ghostcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func IPLookup(addr string) (IPConfig, bool) {
}
} else {
for i := 64; i >= 16; i -= 16 {
mask := net.CIDRMask(i, 32)
mask := net.CIDRMask(i, 128)
addr := fmt.Sprintf("%s/%d", ip.Mask(mask).String(), i)
config, ok = IPMap[addr]
if ok {
Expand Down Expand Up @@ -198,7 +198,7 @@ func IPBlockLookup(addr string) (IPConfig, bool) {
}
} else {
for i := 64; i >= 16; i -= 16 {
mask := net.CIDRMask(i, 32)
mask := net.CIDRMask(i, 128)
addr := fmt.Sprintf("%s/%d", ip.Mask(mask).String(), i)
config, ok = IPMap[addr]
if ok {
Expand Down

0 comments on commit f40e8a4

Please sign in to comment.