merge clone variants
[trinity.git] / net / proto-icmp6.c
blobaa11340e331588618cc28fd8674065d0a560e526
1 #include <stdlib.h>
2 #include <linux/icmpv6.h>
3 #include "net.h"
4 #include "maps.h" // page_rand
5 #include "compat.h"
6 #include "utils.h" // ARRAY_SIZE
8 #define NR_SOL_ICMPV6_OPTS ARRAY_SIZE(icmpv6_opts)
9 static const unsigned int icmpv6_opts[] = { ICMPV6_FILTER };
11 void icmpv6_setsockopt(struct sockopt *so)
13 unsigned char val;
15 so->level = SOL_ICMPV6;
17 val = rand() % NR_SOL_ICMPV6_OPTS;
18 so->optname = icmpv6_opts[val];