Commit 72462e44 authored by Christof Schulze's avatar Christof Schulze Committed by Juliusz Chroboczek

kernel_netlink: Allow to run inside non-privileged docker container

Only set rp_filter to 0 if it contains a different value when
initializing new interfaces. This is helpful to run babeld inside docker
without --privileged
parent 29c129a4
......@@ -677,14 +677,18 @@ kernel_setup_interface(int setup, const char *ifname, int ifindex)
fprintf(stderr,
"Warning: cannot save old configuration for %s.\n",
ifname);
rc = write_proc(buf, 0);
if(rc < 0)
return -1;
if(old_if[i].rp_filter) {
rc = write_proc(buf, 0);
if(rc < 0)
return -1;
}
} else {
if(i >= 0 && old_if[i].rp_filter >= 0)
if(i >= 0 && old_if[i].rp_filter > 0)
rc = write_proc(buf, old_if[i].rp_filter);
else
else if(i < 0)
rc = -1;
else
rc = 1;
if(rc < 0)
fprintf(stderr,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment