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
f5360dfe
Commit
f5360dfe
authored
Sep 11, 2012
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New -F option not to enable forwarding at startup
parent
5b1869b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
25 deletions
+34
-25
babeld.c
babeld.c
+7
-4
babeld.man
babeld.man
+5
-0
kernel_netlink.c
kernel_netlink.c
+22
-21
No files found.
babeld.c
View file @
f5360dfe
...
@@ -99,7 +99,7 @@ int
...
@@ -99,7 +99,7 @@ int
main
(
int
argc
,
char
**
argv
)
main
(
int
argc
,
char
**
argv
)
{
{
struct
sockaddr_in6
sin6
;
struct
sockaddr_in6
sin6
;
int
rc
,
fd
,
i
,
opt
;
int
rc
,
fd
,
i
,
opt
,
setup
=
2
;
time_t
expiry_time
,
source_expiry_time
,
kernel_dump_time
;
time_t
expiry_time
,
source_expiry_time
,
kernel_dump_time
;
const
char
*
config_file
=
NULL
;
const
char
*
config_file
=
NULL
;
void
*
vrc
;
void
*
vrc
;
...
@@ -122,7 +122,7 @@ main(int argc, char **argv)
...
@@ -122,7 +122,7 @@ main(int argc, char **argv)
change_smoothing_half_life
(
4
);
change_smoothing_half_life
(
4
);
while
(
1
)
{
while
(
1
)
{
opt
=
getopt
(
argc
,
argv
,
"m:p:h:H:i:k:A:sruS:d:g:lwz:M:t:T:c:C:DL:I:"
);
opt
=
getopt
(
argc
,
argv
,
"m:p:h:H:i:k:A:sruS:d:g:lwz:M:t:T:c:C:DL:I:
F
"
);
if
(
opt
<
0
)
if
(
opt
<
0
)
break
;
break
;
...
@@ -251,6 +251,9 @@ main(int argc, char **argv)
...
@@ -251,6 +251,9 @@ main(int argc, char **argv)
case
'I'
:
case
'I'
:
pidfile
=
optarg
;
pidfile
=
optarg
;
break
;
break
;
case
'F'
:
setup
=
1
;
break
;
default:
default:
goto
usage
;
goto
usage
;
}
}
...
@@ -350,7 +353,7 @@ main(int argc, char **argv)
...
@@ -350,7 +353,7 @@ main(int argc, char **argv)
close
(
pfd
);
close
(
pfd
);
}
}
rc
=
kernel_setup
(
1
);
rc
=
kernel_setup
(
setup
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
fprintf
(
stderr
,
"kernel_setup failed.
\n
"
);
fprintf
(
stderr
,
"kernel_setup failed.
\n
"
);
goto
fail_pid
;
goto
fail_pid
;
...
@@ -802,7 +805,7 @@ main(int argc, char **argv)
...
@@ -802,7 +805,7 @@ main(int argc, char **argv)
" "
" "
"[-k metric] [-A metric] [-s] [-l] [-w] [-r] [-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
"
"[-
F] [-
t table] [-T table] [-c file] [-C statement]
\n
"
" "
" "
"[-d level] [-D] [-L logfile] [-I pidfile]
\n
"
"[-d level] [-D] [-L logfile] [-I pidfile]
\n
"
" "
" "
...
...
babeld.man
View file @
f5360dfe
...
@@ -99,6 +99,11 @@ Do not flush unfeasible (useless) routes. This is useful in order to
...
@@ -99,6 +99,11 @@ Do not flush unfeasible (useless) routes. This is useful in order to
announce more information to a front-end (see
announce more information to a front-end (see
.BR \-g ).
.BR \-g ).
.TP
.TP
.B \-F
Assume forwarding is already set, or not wanted. By not touching
net.*.conf.all.forwarding at startup, it is also useful to prevent the
kernel from removing a default IPv6 route provided by autoconfiguration.
.TP
.BI \-d " level"
.BI \-d " level"
Debug level. A value of 1 requests a routing table dump at every
Debug level. A value of 1 requests a routing table dump at every
iteration through the daemon's main loop. A value of 2 additionally
iteration through the daemon's main loop. A value of 2 additionally
...
...
kernel_netlink.c
View file @
f5360dfe
...
@@ -494,32 +494,33 @@ kernel_setup(int setup)
...
@@ -494,32 +494,33 @@ kernel_setup(int setup)
}
}
nl_setup
=
1
;
nl_setup
=
1
;
old_forwarding
=
read_proc
(
"/proc/sys/net/ipv6/conf/all/forwarding"
);
if
(
setup
>
1
)
{
if
(
old_forwarding
<
0
)
{
old_forwarding
=
read_proc
(
"/proc/sys/net/ipv6/conf/all/forwarding"
);
perror
(
"Couldn't read forwarding knob."
);
if
(
old_forwarding
<
0
)
{
return
-
1
;
perror
(
"Couldn't read forwarding knob."
);
}
return
-
1
;
}
rc
=
write_proc
(
"/proc/sys/net/ipv6/conf/all/forwarding"
,
1
);
rc
=
write_proc
(
"/proc/sys/net/ipv6/conf/all/forwarding"
,
1
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
perror
(
"Couldn't write forwarding knob."
);
perror
(
"Couldn't write forwarding knob."
);
return
-
1
;
return
-
1
;
}
}
old_ipv4_forwarding
=
old_ipv4_forwarding
=
read_proc
(
"/proc/sys/net/ipv4/conf/all/forwarding"
);
read_proc
(
"/proc/sys/net/ipv4/conf/all/forwarding"
);
if
(
old_ipv4_forwarding
<
0
)
{
if
(
old_ipv4_forwarding
<
0
)
{
perror
(
"Couldn't read IPv4 forwarding knob."
);
perror
(
"Couldn't read IPv4 forwarding knob."
);
return
-
1
;
return
-
1
;
}
}
rc
=
write_proc
(
"/proc/sys/net/ipv4/conf/all/forwarding"
,
1
);
rc
=
write_proc
(
"/proc/sys/net/ipv4/conf/all/forwarding"
,
1
);
if
(
rc
<
0
)
{
if
(
rc
<
0
)
{
perror
(
"Couldn't write IPv4 forwarding knob."
);
perror
(
"Couldn't write IPv4 forwarding knob."
);
return
-
1
;
return
-
1
;
}
}
}
old_accept_redirects
=
old_accept_redirects
=
read_proc
(
"/proc/sys/net/ipv6/conf/all/accept_redirects"
);
read_proc
(
"/proc/sys/net/ipv6/conf/all/accept_redirects"
);
if
(
old_accept_redirects
<
0
)
{
if
(
old_accept_redirects
<
0
)
{
...
...
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