X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=extensions%2Flibipt_psd.c;fp=extensions%2Flibipt_psd.c;h=3d0034ab46da636569b3d52fdadffb8186f9dbfb;hb=6afea0b41dfbc3824956d11d960ad80097218feb;hp=8a6198e0d8217560156a96d1211d7bf6d46f3df5;hpb=f7b70cf9e00324b89b02de213bcd0dde7044d035;p=iptables.git diff --git a/extensions/libipt_psd.c b/extensions/libipt_psd.c index 8a6198e..3d0034a 100644 --- a/extensions/libipt_psd.c +++ b/extensions/libipt_psd.c @@ -56,8 +56,6 @@ init(struct ipt_entry_match *m, unsigned int *nfcache) psdinfo->delay_threshold = SCAN_DELAY_THRESHOLD; psdinfo->lo_ports_weight = PORT_WEIGHT_PRIV; psdinfo->hi_ports_weight = PORT_WEIGHT_HIGH; - /* Can't cache this */ - *nfcache |= NFC_UNKNOWN; } @@ -84,11 +82,6 @@ parse(int c, char **argv, int invert, unsigned int *flags, struct ipt_psd_info *psdinfo = (struct ipt_psd_info *)(*match)->data; unsigned int num; - if (!optarg) - exit_error(PARAMETER_PROBLEM, "missing optarg"); - - /* string_to_number needs a leading space */ - switch (c) { /* PSD-weight-threshold */ case '1': @@ -180,20 +173,19 @@ save(const struct ipt_ip *ip, const struct ipt_entry_match *match) printf("--psd-hi-ports-weight %u ", psdinfo->hi_ports_weight); } -static -struct iptables_match psd -= { NULL, - "psd", - IPTABLES_VERSION, - IPT_ALIGN(sizeof(struct ipt_psd_info)), - IPT_ALIGN(sizeof(struct ipt_psd_info)), - &help, - &init, - &parse, - &final_check, - &print, - &save, - opts +static struct iptables_match psd = { + .next = NULL, + .name = "psd", + .version = IPTABLES_VERSION, + .size = IPT_ALIGN(sizeof(struct ipt_psd_info)), + .userspacesize = IPT_ALIGN(sizeof(struct ipt_psd_info)), + .help = &help, + .init = &init, + .parse = &parse, + .final_check = &final_check, + .print = &print, + .save = &save, + .extra_opts = opts }; void _init(void)