I want to set some local sysctl parameters with my program and I followed the directions given here: http://www.linux.it/~rubini/docs/sysctl/
As an example, here's what I'm doing to set the value for /proc/sys/net/ipv6/conf/tun0/accept_ra
. I just configured my tun0
interface prior to this call. (I verified that my interface is up and I was able to assign an IP address as well)
int path_len = 5;
int tun0_accept_ra_path[] = { CTL_NET,
NET_IPV6,
NET_IPV6_CONF,
ifr6.ifr6_ifindex, // This ifindex comes from an interface configured above
NET_IPV6_ACCEPT_RA };
int tun0_accept_ra_value = 0;
if (sysctl(tun0_accept_ra_path,
path_len,
NULL,
0,
&tun0_accept_ra_value,
sizeof(tun0_accept_ra_value)) < 0) {
printf("set sysctl 'accept_ra' failed. errno: %d\n", errno);
}
I get: set sysctl 'accept_ra' failed. errno: 38 Function not implemented
Any thoughts as to what could be wrong? I'm running as sudo so I don't think I should have access privilege issues.
I'm running Debian GNU/Linux 7.0 (wheezy) on a raspberry pi.