summaryrefslogtreecommitdiff
path: root/usr.sbin/rtsold/rtsold.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2011-03-23 00:59:50 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2011-03-23 00:59:50 +0000
commit5d04f8056892be3b9bc86b4387219a05ed2216eb (patch)
tree0a1ebf23cbea1b1522a5a2bfe6d0d0bed01a6e02 /usr.sbin/rtsold/rtsold.c
parentea744420a76676e0bb43535298d5adcb79fe1040 (diff)
Print a warning when rtsol or rtsold are used to do IPv6 autoconfiguration
but accepting redirects is turned off. If the -F switch is given, set sysctl net.inet6.icmp6.rediraccept to 1 instead. ok claudio@ deraadt@ sthen@
Diffstat (limited to 'usr.sbin/rtsold/rtsold.c')
-rw-r--r--usr.sbin/rtsold/rtsold.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/rtsold/rtsold.c b/usr.sbin/rtsold/rtsold.c
index dd09869f0cd..6430eb7e141 100644
--- a/usr.sbin/rtsold/rtsold.c
+++ b/usr.sbin/rtsold/rtsold.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtsold.c,v 1.46 2011/03/22 10:16:23 okan Exp $ */
+/* $OpenBSD: rtsold.c,v 1.47 2011/03/23 00:59:49 bluhm Exp $ */
/* $KAME: rtsold.c,v 1.75 2004/01/03 00:00:07 itojun Exp $ */
/*
@@ -185,14 +185,18 @@ main(int argc, char *argv[])
#endif
if (Fflag) {
- setinet6sysctl(IPV6CTL_ACCEPT_RTADV, 1);
- setinet6sysctl(IPV6CTL_FORWARDING, 0);
+ setinet6sysctl(IPPROTO_IPV6, IPV6CTL_ACCEPT_RTADV, 1);
+ setinet6sysctl(IPPROTO_ICMPV6, ICMPV6CTL_REDIRACCEPT, 1);
+ setinet6sysctl(IPPROTO_IPV6, IPV6CTL_FORWARDING, 0);
} else {
/* warn if accept_rtadv is down */
- if (!getinet6sysctl(IPV6CTL_ACCEPT_RTADV))
+ if (!getinet6sysctl(IPPROTO_IPV6, IPV6CTL_ACCEPT_RTADV))
warnx("kernel is configured not to accept RAs");
+ /* warn if accepting redirects is off */
+ if (!getinet6sysctl(IPPROTO_ICMPV6, ICMPV6CTL_REDIRACCEPT))
+ warnx("kernel is configured not to accept redirects");
/* warn if forwarding is up */
- if (getinet6sysctl(IPV6CTL_FORWARDING))
+ if (getinet6sysctl(IPPROTO_IPV6, IPV6CTL_FORWARDING))
warnx("kernel is configured as a router, not a host");
}