summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtsold/if.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2004-01-14 17:42:03 +0000
committerume <ume@FreeBSD.org>2004-01-14 17:42:03 +0000
commit7fa7bd6ad2ca27f28c91cc116d9cad1aabbf9e73 (patch)
treecccc02033f7c2ccb5644562f4c92694699fc5194 /usr.sbin/rtsold/if.c
parentab3e3db491512f6183cc555d21572b96c642da08 (diff)
downloadFreeBSD-src-7fa7bd6ad2ca27f28c91cc116d9cad1aabbf9e73.zip
FreeBSD-src-7fa7bd6ad2ca27f28c91cc116d9cad1aabbf9e73.tar.gz
add -F flag, which configures sysctl(8) setting by rtsold
itself (rather than warn about the current setting). Obtained from: KAME
Diffstat (limited to 'usr.sbin/rtsold/if.c')
-rw-r--r--usr.sbin/rtsold/if.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c
index 99a1b0e..23e4e6f 100644
--- a/usr.sbin/rtsold/if.c
+++ b/usr.sbin/rtsold/if.c
@@ -300,6 +300,22 @@ getinet6sysctl(int code)
return value;
}
+int
+setinet6sysctl(int code, int newval)
+{
+ int mib[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 };
+ int value;
+ size_t size;
+
+ mib[3] = code;
+ size = sizeof(value);
+ if (sysctl(mib, sizeof(mib)/sizeof(mib[0]), &value, &size,
+ &newval, sizeof(newval)) < 0)
+ return -1;
+ else
+ return value;
+}
+
/*------------------------------------------------------------*/
/* get ia6_flags for link-local addr on if. returns -1 on error. */
OpenPOWER on IntegriCloud