Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
re6stnet
Commits
c899b4ec
Commit
c899b4ec
authored
Jul 25, 2012
by
Guillaume Bury
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaner handling of reading lines for routes
parent
de4d352d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
19 deletions
+11
-19
TODO
TODO
+4
-10
db.py
db.py
+1
-0
tunnel.py
tunnel.py
+6
-9
No files found.
TODO
View file @
c899b4ec
...
...
@@ -8,20 +8,14 @@ To be done :
favorise most used roads
Handle LAN internally in order not to have catastrophic results ....
the first thing to do is to include the LAN iface on the intarfaces
given to babel => pb : someone who has a lan acces to our network can
provide false informations. Needs of signature
If it is not sufficient, we could use avahi (dm-dns for linux)
pb : someone who has a lan acces to our network can provide false
informations. Needs of signature
=> yeah it is a security problem to fix
Write docstrings for all class/methods/functions
To be discussed:
G : There is a blacklist system now ( blacklisted prefixes are deleted from
the peers database ). Since all nodes whose packets are routed through
the local network are blacklisted, I think we should reset the blacklist
from time to time....
U : Babel seems to be very long to establish the routes : maybe we should
tell him thant we are not on a wired network but on a mobile network ?
G : babel establish routes quickly enough i'd say. There are two new
...
...
db.py
View file @
c899b4ec
...
...
@@ -135,3 +135,4 @@ class PeerManager:
else
:
utils
.
log
(
'Unknow message recieved from the openvpn pipe : '
+
msg
,
1
)
tunnel.py
View file @
c899b4ec
...
...
@@ -5,7 +5,6 @@ log = None
smooth
=
0.3
# this is used to smooth the traffic sampling. Lower value
# mean more smooth
# Be carfull the refresh interval should let the routes be established
...
...
@@ -153,15 +152,13 @@ class TunnelManager:
self
.
_peer_db
.
clear_blacklist
(
0
)
for
iface
in
self
.
_iface_to_prefix
.
keys
():
self
.
_connection_dict
[
self
.
_iface_to_prefix
[
iface
]].
routes
=
0
f
=
open
(
'/proc/net/ipv6_route'
,
'r'
)
for
line
in
f
:
ip
,
subnet_size
,
iface
=
struct
.
unpack
(
'32s x 2s 106x %ss x'
%
(
len
(
line
)
-
142
),
line
)
ip
=
bin
(
int
(
ip
,
16
))[
2
:].
rjust
(
128
,
'0'
)
for
line
in
open
(
'/proc/net/ipv6_route'
):
line
=
line
.
split
()
ip
=
bin
(
int
(
line
[
0
],
16
))[
2
:].
rjust
(
128
,
'0'
)
if
ip
.
startswith
(
self
.
_network
):
iface
=
iface
.
strip
()
subnet_size
=
int
(
subnet_size
,
16
)
iface
=
line
[
-
1
]
subnet_size
=
int
(
line
[
1
]
,
16
)
utils
.
log
(
'Route on iface %s detected to %s/%s'
%
(
iface
,
ip
,
subnet_size
),
8
)
if
iface
in
self
.
_iface_to_prefix
.
keys
():
...
...
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