diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2011-10-27 10:26:39 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-10-28 21:34:28 +0200 |
commit | 370010dbbf0dad175648def90bbed4e51a04320f (patch) | |
tree | cb6cbf94eec043728e60c115c4a1ea247baf37fd /src/iptables.c | |
parent | fdf8bd453137e4d575e1ea39745d6aa7311cefed (diff) | |
download | connman-370010dbbf0dad175648def90bbed4e51a04320f.tar.gz connman-370010dbbf0dad175648def90bbed4e51a04320f.tar.bz2 connman-370010dbbf0dad175648def90bbed4e51a04320f.zip |
iptables: Add extensions options parsing for matches
Diffstat (limited to 'src/iptables.c')
-rw-r--r-- | src/iptables.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/iptables.c b/src/iptables.c index d64a1519..1668df7e 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -1385,8 +1385,8 @@ done: static int iptables_command(int argc, char *argv[]) { struct connman_iptables *table; - struct xtables_rule_match *xt_rm; - struct xtables_match *xt_m; + struct xtables_rule_match *xt_rm, *tmp_xt_rm; + struct xtables_match *xt_m, *xt_m_t; struct xtables_target *xt_t; struct ipt_ip ip; char *table_name, *chain, *new_chain, *match_name, *target_name; @@ -1550,6 +1550,28 @@ static int iptables_command(int argc, char *argv[]) XT_OPTION_OFFSET_SCALE)) { xtables_option_tpcall(c, argv, invert, xt_t, NULL); + + break; + } + + for (tmp_xt_rm = xt_rm; tmp_xt_rm != NULL; + tmp_xt_rm = tmp_xt_rm->next) { + xt_m_t = tmp_xt_rm->match; + + if (tmp_xt_rm->completed || + (xt_m_t->x6_parse == NULL && + xt_m_t->parse == NULL)) + continue; + + if (c < (int) xt_m_t->option_offset || + c >= (int) xt_m_t->option_offset + + XT_OPTION_OFFSET_SCALE) + continue; + + xtables_option_mpcall(c, argv, + invert, xt_m_t, NULL); + + break; } break; |