Skip to content

Commit

Permalink
Merge pull request #39 from aries15/patch-1
Browse files Browse the repository at this point in the history
Fix ipv6 net.CIDRMask
  • Loading branch information
macronut authored Dec 20, 2022
2 parents f472e71 + f40e8a4 commit 07427dc
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 07427dc

Please sign in to comment.