From: Tomasz Bursztyka Date: Thu, 27 Oct 2011 07:24:52 +0000 (+0300) Subject: tools: Add extensions options parsing for target to iptables_test X-Git-Tag: 2.0_alpha~1001 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc44407d75850208300cd997aeb6f74aa4f85b6c;p=framework%2Fconnectivity%2Fconnman.git tools: Add extensions options parsing for target to iptables_test --- diff --git a/tools/iptables-test.c b/tools/iptables-test.c index 56598aa..ac50823 100644 --- a/tools/iptables-test.c +++ b/tools/iptables-test.c @@ -46,6 +46,8 @@ static const char *hooknames[] = { #define LABEL_QUEUE "QUEUE" #define LABEL_RETURN "RETURN" +#define XT_OPTION_OFFSET_SCALE 256 + /* fn returns 0 to continue iteration */ #define _XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...) \ ({ \ @@ -1531,14 +1533,13 @@ int main(int argc, char *argv[]) return -1; default: - if (xt_t == NULL || xt_t->parse == NULL || - !xt_t->parse(c - xt_t->option_offset, argv, invert, - &xt_t->tflags, NULL, &xt_t->t)) { - if (xt_m == NULL || xt_m->parse == NULL) - break; - - xt_m->parse(c - xt_m->option_offset, argv, - invert, &xt_m->mflags, NULL, &xt_m->m); + if (xt_t != NULL && (xt_t->x6_parse != NULL || + xt_t->parse != NULL) && + (c >= (int) xt_t->option_offset && + c < (int) xt_t->option_offset + + XT_OPTION_OFFSET_SCALE)) { + xtables_option_tpcall(c, argv, + invert, xt_t, NULL); } break;