iptables-1.3.2-20050720
[iptables.git] / extensions / libipt_random.c
index 97f09a4..d28ab8c 100644 (file)
@@ -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)