~ubuntu-branches/debian/sid/trinity/sid

« back to all changes in this revision

Viewing changes to net/icmp6_setsockopt.c

  • Committer: Package Import Robot
  • Author(s): gustavo panizzo
  • Date: 2014-01-17 21:10:15 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140117211015-k2qbnpu0osa5mlil
Tags: 1.3-1
* New upstream version 1.3.
* Removed wrong dependency on linux-headers. (Closes: #733771).

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 "trinity.h"    // ARRAY_SIZE
7
 
 
8
 
#define NR_SOL_ICMPV6_OPTS ARRAY_SIZE(icmpv6_opts)
9
 
static const unsigned int icmpv6_opts[] = { ICMPV6_FILTER };
10
 
 
11
 
void icmpv6_setsockopt(struct sockopt *so)
12
 
{
13
 
        unsigned char val;
14
 
 
15
 
        so->level = SOL_ICMPV6;
16
 
 
17
 
        val = rand() % NR_SOL_ICMPV6_OPTS;
18
 
        so->optname = icmpv6_opts[val];
19
 
}