Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
e2aecf92
Commit
e2aecf92
authored
May 26, 2017
by
Tomáš Peterka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add more information to the TUN interface
parent
6a37f505
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
slapos/format.py
slapos/format.py
+5
-1
No files found.
slapos/format.py
View file @
e2aecf92
...
@@ -906,7 +906,11 @@ class Tun(Tap):
...
@@ -906,7 +906,11 @@ class Tun(Tap):
mask_shift
=
int
(
math
.
ceil
(
math
.
log
(
int
(
partitions
),
2.0
)))
mask_shift
=
int
(
math
.
ceil
(
math
.
log
(
int
(
partitions
),
2.0
)))
# IPNetwork.subnet returns iterator over all possible subnets of given mask
# IPNetwork.subnet returns iterator over all possible subnets of given mask
ip_subnets
=
list
(
ip_network
.
subnet
(
Tun
.
BASE_MASK
+
mask_shift
))
ip_subnets
=
list
(
ip_network
.
subnet
(
Tun
.
BASE_MASK
+
mask_shift
))
self
.
ipv4_network
=
self
.
ipv4_addr
=
str
(
ip_subnets
[
sequence
])
subnet
=
ip_subnets
[
sequence
]
# For serialization purposes, convert directly to ``str``
self
.
ipv4_network
=
str
(
subnet
)
self
.
ipv4_addr
=
str
(
subnet
.
ip
)
self
.
ipv4_netmask
=
str
(
subnet
.
netmask
)
def
createRoutes
(
self
):
def
createRoutes
(
self
):
"""Extend for physical addition of network address because TAP let this on external class."""
"""Extend for physical addition of network address because TAP let this on external class."""
...
...
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