Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
powder-vpn
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
David Johnson
powder-vpn
Commits
0d3097ab
Commit
0d3097ab
authored
Aug 24, 2018
by
David Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix to network string generation; we were generating the broadcast addr.
parent
0eb8cdcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
profile/profile.py
profile/profile.py
+3
-3
No files found.
profile/profile.py
View file @
0d3097ab
...
...
@@ -130,14 +130,14 @@ class IPAssign(object):
if
netnum
>=
nextbasenum
:
raise
Exception
(
"out of subnet space in /%d at network %s (/%d)"
%
(
basebits
,
name
,
bitsize
))
network
num
=
netnum
+
(
2
**
(
32
-
bitsize
))
-
1
bcast
num
=
netnum
+
(
2
**
(
32
-
bitsize
))
-
1
netmask
=
0
for
i
in
range
(
32
-
bitsize
,
32
):
netmask
|=
(
1
<<
i
)
self
.
subnets
[
name
]
=
{
'bits'
:
bitsize
,
'netnum'
:
netnum
,
'networknum'
:
net
worknum
,
'
networkstr'
:
IPAssign
.
__htoa
(
network
num
),
'networknum'
:
net
num
,
'networkstr'
:
IPAssign
.
__htoa
(
netnum
)
,
'
bcastnum'
:
bcastnum
,
'bcaststr'
:
IPAssign
.
__htoa
(
bcast
num
),
'hostnum'
:
0
,
'maxhosts'
:
2
**
(
32
-
bitsize
)
-
1
,
'addrs'
:[],
'netmask'
:
netmask
,
'netmaskstr'
:
IPAssign
.
__htoa
(
netmask
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment