Skip to content

修复IPv4Address::networdAddress中IPv4网络地址计算错误的问题 - #40

Open
evanliang6 wants to merge 1 commit into
sylar-yin:masterfrom
evanliang6:master
Open

修复IPv4Address::networdAddress中IPv4网络地址计算错误的问题#40
evanliang6 wants to merge 1 commit into
sylar-yin:masterfrom
evanliang6:master

Conversation

@evanliang6

Copy link
Copy Markdown

内容:networdAddress() 函数当前返回的是主机部分(例如 0.0.0.10),而非网络地址
原因:它与主机掩码进行与运算,而非与子网掩码进行与运算
• 测试:
IP : 192.168.1.10:0
Prefix : /24
Network : 0.0.0.10:0
修改后为192.168.1.0

…dAddress

What: networdAddress() currently returns host part (e.g. 0.0.0.10) instead of network address

Why: it ANDs with host mask instead of subnet mask

How: use ~CreateMask() consistent with broadcast/subnetMask

Test: show 192.168.1.10/24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant