From: Tomasz Bursztyka Date: Thu, 27 Oct 2011 07:26:34 +0000 (+0300) Subject: iptables: Move target and matches preparation routines X-Git-Tag: 2.0_alpha~989 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e1a4156c5edeae0f75cd53e87a0482f785def9cb;p=framework%2Fconnectivity%2Fconnman.git iptables: Move target and matches preparation routines --- diff --git a/src/iptables.c b/src/iptables.c index e1370c4..e3129f6 100644 --- a/src/iptables.c +++ b/src/iptables.c @@ -1462,10 +1462,18 @@ static int iptables_command(int argc, char *argv[]) case 'j': target_name = optarg; + xt_t = prepare_target(table, target_name); + if (xt_t == NULL) + goto out; + break; case 'm': match_name = optarg; + xt_m = prepare_matches(table, &xt_rm, match_name); + if (xt_m == NULL) + goto out; + break; case 'o': @@ -1572,16 +1580,9 @@ static int iptables_command(int argc, char *argv[]) } if (chain) { - xt_t = prepare_target(table, target_name); if (xt_t == NULL) goto out; - if (match_name != NULL) { - xt_m = prepare_matches(table, &xt_rm, match_name); - if (xt_m == NULL) - goto out; - } - if (delete == TRUE) { DBG("Deleting %s to %s (match %s)\n", target_name, chain, match_name);