X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=extensions%2Flibipt_random.c;h=d28ab8ce97cc59761e1fd22b563a3b966492c07c;hb=6afea0b41dfbc3824956d11d960ad80097218feb;hp=97f09a42b26f2110d29e66f05dad9c4be00a0c58;hpb=f7b70cf9e00324b89b02de213bcd0dde7044d035;p=iptables.git diff --git a/extensions/libipt_random.c b/extensions/libipt_random.c index 97f09a4..d28ab8c 100644 --- a/extensions/libipt_random.c +++ b/extensions/libipt_random.c @@ -35,7 +35,7 @@ help(void) { printf( "random v%s options:\n" -" [--average] percent The probability in percentage of the match\n" +" [--average percent ] The probability in percentage of the match\n" " If ommited, a probability of 50%% percent is set.\n" " Percentage must be within : 1 <= percent <= 99.\n\n", IPTABLES_VERSION); @@ -51,7 +51,6 @@ static void init(struct ipt_entry_match *m, unsigned int *nfcache) { struct ipt_rand_info *randinfo = (struct ipt_rand_info *)(m)->data; - *nfcache |= NFC_UNKNOWN; /* We assign the average to be 50 which is our default value */ /* 50 * 2.55 = 128 */ @@ -130,19 +129,19 @@ save(const struct ipt_ip *ip, const struct ipt_entry_match *match) printf("--average %u ", result.quot); } -struct iptables_match rand_match -= { NULL, - "random", - IPTABLES_VERSION, - IPT_ALIGN(sizeof(struct ipt_rand_info)), - IPT_ALIGN(sizeof(struct ipt_rand_info)), - &help, - &init, - &parse, - &final_check, - &print, - &save, - opts +struct iptables_match rand_match = { + .next = NULL, + .name = "random", + .version = IPTABLES_VERSION, + .size = IPT_ALIGN(sizeof(struct ipt_rand_info)), + .userspacesize = IPT_ALIGN(sizeof(struct ipt_rand_info)), + .help = &help, + .init = &init, + .parse = &parse, + .final_check = &final_check, + .print = &print, + .save = &save, + .extra_opts = opts }; void _init(void)