Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
babeld
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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
babeld
Commits
4ab89604
Commit
4ab89604
authored
Nov 07, 2012
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement random router-ids (-r).
parent
69348bb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
4 deletions
+17
-4
babeld.c
babeld.c
+11
-4
babeld.man
babeld.man
+6
-0
No files found.
babeld.c
View file @
4ab89604
...
...
@@ -100,7 +100,7 @@ int
main
(
int
argc
,
char
**
argv
)
{
struct
sockaddr_in6
sin6
;
int
rc
,
fd
,
i
,
opt
;
int
rc
,
fd
,
i
,
opt
,
random_id
=
0
;
time_t
expiry_time
,
source_expiry_time
,
kernel_dump_time
;
char
*
config_file
=
NULL
;
void
*
vrc
;
...
...
@@ -123,7 +123,7 @@ main(int argc, char **argv)
change_smoothing_half_life
(
4
);
while
(
1
)
{
opt
=
getopt
(
argc
,
argv
,
"m:p:h:H:i:k:A:suS:d:g:lwz:M:t:T:c:C:DL:I:"
);
opt
=
getopt
(
argc
,
argv
,
"m:p:h:H:i:k:A:s
r
uS:d:g:lwz:M:t:T:c:C:DL:I:"
);
if
(
opt
<
0
)
break
;
...
...
@@ -173,6 +173,9 @@ main(int argc, char **argv)
case
's'
:
split_horizon
=
0
;
break
;
case
'r'
:
random_id
=
1
;
break
;
case
'u'
:
keep_unfeasible
=
1
;
break
;
...
...
@@ -377,6 +380,9 @@ main(int argc, char **argv)
goto
fail
;
}
if
(
random_id
)
goto
random_id
;
FOR_ALL_INTERFACES
(
ifp
)
{
/* ifp->ifindex is not necessarily valid at this point */
int
ifindex
=
if_nametoindex
(
ifp
->
name
);
...
...
@@ -408,6 +414,7 @@ main(int argc, char **argv)
fprintf
(
stderr
,
"Warning: couldn't find router id -- using random value.
\n
"
);
random_id:
rc
=
read_random_bytes
(
myid
,
8
);
if
(
rc
<
0
)
{
perror
(
"read(random)"
);
...
...
@@ -452,7 +459,7 @@ main(int argc, char **argv)
gettimeofday
(
&
realnow
,
NULL
);
if
(
memcmp
(
sid
,
myid
,
8
)
==
0
)
myseqno
=
seqno_plus
(
s
,
1
);
else
else
if
(
!
random_id
)
fprintf
(
stderr
,
"ID mismatch in babel-state.
\n
"
);
}
}
else
{
...
...
@@ -787,7 +794,7 @@ main(int argc, char **argv)
" "
"[-h hello] [-H wired_hello] [-z kind[,factor]]
\n
"
" "
"[-k metric] [-A metric] [-s] [-l] [-w] [-u] [-g port]
\n
"
"[-k metric] [-A metric] [-s] [-l] [-w] [-
r] [-
u] [-g port]
\n
"
" "
"[-t table] [-T table] [-c file] [-C statement]
\n
"
" "
...
...
babeld.man
View file @
4ab89604
...
...
@@ -88,6 +88,12 @@ explicitly overridden in the configuration file.
Do not perform split-horizon processing on wired interfaces.
Split-horizon is not performed on wireless interfaces.
.TP
.B \-r
Use a random router-id. The default is to use persistent router-ids
derived from the MAC address of the first interface, which is easier
to debug and more reliably prevents routing loops but may sometimes
cause a node to be unreachable for 120 seconds just after boot.
.TP
.B \-u
Do not flush unfeasible (useless) routes. This is useful in order to
announce more information to a front-end (see
...
...
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