summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rad
diff options
context:
space:
mode:
authorflorian <florian@openbsd.org>2018-07-18 14:43:34 +0000
committerflorian <florian@openbsd.org>2018-07-18 14:43:34 +0000
commite38f348df6744326f973a98d930a1435d3e53191 (patch)
tree873ffa65442ca827246d2703c00eaf4c21472f61 /usr.sbin/rad
parenttidy up the flags section a little: supply a little more indent, and reduce (diff)
downloadwireguard-openbsd-e38f348df6744326f973a98d930a1435d3e53191.tar.xz
wireguard-openbsd-e38f348df6744326f973a98d930a1435d3e53191.zip
Stop our own router advertisements from looping back to us.
Pointed out by semarie@
Diffstat (limited to 'usr.sbin/rad')
-rw-r--r--usr.sbin/rad/rad.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/rad/rad.c b/usr.sbin/rad/rad.c
index 36b68f2e318..4652e1e0fb7 100644
--- a/usr.sbin/rad/rad.c
+++ b/usr.sbin/rad/rad.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rad.c,v 1.8 2018/07/15 09:28:21 florian Exp $ */
+/* $OpenBSD: rad.c,v 1.9 2018/07/18 14:43:34 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -129,7 +129,7 @@ main(int argc, char *argv[])
char *saved_argv0;
int pipe_main2frontend[2];
int pipe_main2engine[2];
- int icmp6sock, on = 1;
+ int icmp6sock, on = 1, off = 0;
int frontend_routesock, rtfilter;
int control_fd;
@@ -275,6 +275,10 @@ main(int argc, char *argv[])
sizeof(on)) < 0)
fatal("IPV6_RECVHOPLIMIT");
+ if (setsockopt(icmp6sock, IPPROTO_IPV6, IPV6_MULTICAST_LOOP, &off,
+ sizeof(off)) < 0)
+ fatal("IPV6_RECVHOPLIMIT");
+
/* only router advertisements and solicitations */
ICMP6_FILTER_SETBLOCKALL(&filt);
ICMP6_FILTER_SETPASS(ND_ROUTER_ADVERT, &filt);