From 93e868c730dc0b1825b2a685e0b066c051b1cb07 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Sun, 13 Mar 2011 11:33:50 +0100 Subject: Implements Router Advertisement protocol. --- sysdep/autoconf.h.in | 1 + sysdep/unix/io.c | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'sysdep') diff --git a/sysdep/autoconf.h.in b/sysdep/autoconf.h.in index 66e66a8..4739fba 100644 --- a/sysdep/autoconf.h.in +++ b/sysdep/autoconf.h.in @@ -35,6 +35,7 @@ /* Protocols compiled in */ #undef CONFIG_STATIC #undef CONFIG_RIP +#undef CONFIG_RADV #undef CONFIG_BGP #undef CONFIG_OSPF #undef CONFIG_PIPE diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index a552a2a..29be9a8 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "nest/bird.h" #include "lib/lists.h" @@ -880,6 +881,25 @@ sk_set_ipv6_checksum(sock *s, int offset) return 0; } +int +sk_set_icmp_filter(sock *s, int p1, int p2) +{ + /* a bit of lame interface, but it is here only for Radv */ + struct icmp6_filter f; + + ICMP6_FILTER_SETBLOCKALL(&f); + ICMP6_FILTER_SETPASS(p1, &f); + ICMP6_FILTER_SETPASS(p2, &f); + + if (setsockopt(s->fd, IPPROTO_ICMPV6, ICMP6_FILTER, &f, sizeof(f)) < 0) + { + log(L_ERR "sk_setup_icmp_filter: ICMP6_FILTER: %m"); + return -1; + } + + return 0; +} + int sk_setup_multicast(sock *s) { @@ -951,7 +971,6 @@ sk_leave_group(sock *s, ip_addr maddr) return 0; } - #else /* IPV4 */ int -- cgit v1.2.3