Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add whitelist for local-host ip #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion chnroutes.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,15 @@ def fetch_ip_data():
mask2=32-int(math.log(num_ip,2))

results.append((starting_ip,mask,mask2))


# add whitelist for local-host ip
local_ip = [ '10.0.0.0', '127.0.0.0', '172.0.0.0', '198.0.0.0']
local_mask = ['255.0.0.0', '255.0.0.0', '255.0.0.0', '255.0.0.0']
local_mask2 = [16777216, 16777216, 16777216, 16777216]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这 mask 不对吧?你这样做 GitHub 会不开心的。

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈哈哈,这个 mask 粒度有点粗啊


for index in range(len(local_ip)):
results.append((local_ip[index], local_mask[index], local_mask2[index]))

return results


Expand Down