mirror of
https://gitlab.labs.nic.cz/labs/bird.git
synced 2024-05-11 16:54:54 +00:00
Implements Router Advertisement protocol.
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <sys/un.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <netinet/icmp6.h>
|
||||
|
||||
#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
|
||||
|
Reference in New Issue
Block a user