clean up the remap_file_pages sanitize routine
[trinity.git] / net / pppol2tp_setsockopt.c
blobbc4222ba3e09b1c01335f658ef75a435984f392c
1 #include <stdlib.h>
2 #include <netinet/in.h>
3 #include <linux/if_pppol2tp.h>
4 #include "net.h"
5 #include "compat.h"
6 #include "utils.h" // ARRAY_SIZE
8 #define SOL_PPPOL2TP 273
10 #define NR_SOL_PPPOL2TP_OPTS ARRAY_SIZE(pppol2tp_opts)
11 static const unsigned int pppol2tp_opts[] = {
12 PPPOL2TP_SO_DEBUG, PPPOL2TP_SO_RECVSEQ, PPPOL2TP_SO_SENDSEQ, PPPOL2TP_SO_LNSMODE,
13 PPPOL2TP_SO_REORDERTO };
15 void pppol2tp_setsockopt(struct sockopt *so)
17 unsigned char val;
19 so->level = SOL_PPPOL2TP;
21 val = rand() % NR_SOL_PPPOL2TP_OPTS;
22 so->optname = pppol2tp_opts[val];
24 so->optval = sizeof(int);