X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=extensions%2Flibipt_u32.c;h=7504510038212aea96adb3ea54111660fc3ba971;hb=6afea0b41dfbc3824956d11d960ad80097218feb;hp=788413c85a63bd607ebed58903a840562ed3fcb4;hpb=f7b70cf9e00324b89b02de213bcd0dde7044d035;p=iptables.git diff --git a/extensions/libipt_u32.c b/extensions/libipt_u32.c index 788413c..7504510 100644 --- a/extensions/libipt_u32.c +++ b/extensions/libipt_u32.c @@ -37,13 +37,6 @@ static struct option opts[] = { { 0 } }; -/* Initialize the match. */ -static void -init(struct ipt_entry_match *m, unsigned int *nfcache) -{ - *nfcache |= NFC_UNKNOWN; -} - /* shared printing code */ static void print_u32(struct ipt_u32 *data) { @@ -85,7 +78,7 @@ u_int32_t parse_number(char **s, int pos) char *end; errno = 0; - number = strtol(*s, &end, 0); + number = strtoul(*s, &end, 0); if (end == *s) exit_error(PARAMETER_PROBLEM, "u32: at char %d expected number", pos); @@ -250,19 +243,18 @@ static void save(const struct ipt_ip *ip, const struct ipt_entry_match *match) print_u32((struct ipt_u32 *)match->data); } -struct iptables_match u32 -= { NULL, - "u32", - IPTABLES_VERSION, - IPT_ALIGN(sizeof(struct ipt_u32)), - IPT_ALIGN(sizeof(struct ipt_u32)), - &help, - &init, - &parse, - &final_check, - &print, - &save, - opts +struct iptables_match u32 = { + .next = NULL, + .name = "u32", + .version = IPTABLES_VERSION, + .size = IPT_ALIGN(sizeof(struct ipt_u32)), + .userspacesize = IPT_ALIGN(sizeof(struct ipt_u32)), + .help = &help, + .parse = &parse, + .final_check = &final_check, + .print = &print, + .save = &save, + .extra_opts = opts }; void