[PATCH 3/8] iptables: use variable as shortcut in parse loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"m" is around, so use it, cut the code.

Signed-off-by: Jan Engelhardt <jengelh@xxxxxxxxxx>
---
 ip6tables.c |   17 ++++++++---------
 iptables.c  |   17 ++++++++---------
 2 files changed, 16 insertions(+), 18 deletions(-)

diff --git a/ip6tables.c b/ip6tables.c
index f581509..caee730 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -1714,17 +1714,16 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
 					       &fw, &target->t))
 				break;
 			for (matchp = matches; matchp; matchp = matchp->next) {
-				if (matchp->completed ||
-				    matchp->match->parse == NULL)
+				m = matchp->match;
+
+				if (matchp->completed || m->parse == NULL)
 					continue;
-				if (c < matchp->match->option_offset ||
-				    c >= matchp->match->option_offset + XT_OPTION_OFFSET_SCALE)
+				if (c < m->option_offset ||
+				    c >= m->option_offset + XT_OPTION_OFFSET_SCALE)
 					continue;
-				if (matchp->match->parse(c - matchp->match->option_offset,
-					     argv, invert,
-					     &matchp->match->mflags,
-					     &fw,
-					     &matchp->match->m)) {
+				if (m->parse(c - matchp->match->option_offset,
+					     argv, invert, &m->mflags, &fw,
+					     &m->m)) {
 					stop = true;
 					break;
 				}
diff --git a/iptables.c b/iptables.c
index b957e66..db8e136 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1746,17 +1746,16 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
 					       &fw, &target->t))
 				break;
 			for (matchp = matches; matchp; matchp = matchp->next) {
-				if (matchp->completed ||
-				    matchp->match->parse == NULL)
+				m = matchp->match;
+
+				if (matchp->completed || m->parse == NULL)
 					continue;
-				if (c < matchp->match->option_offset ||
-				    c >= matchp->match->option_offset + XT_OPTION_OFFSET_SCALE)
+				if (c < m->option_offset ||
+				    c >= m->option_offset + XT_OPTION_OFFSET_SCALE)
 					continue;
-				if (matchp->match->parse(c - matchp->match->option_offset,
-					     argv, invert,
-					     &matchp->match->mflags,
-					     &fw,
-					     &matchp->match->m)) {
+				if (m->parse(c - matchp->match->option_offset,
+					     argv, invert, &m->mflags, &fw,
+					     &m->m)) {
 					stop = true;
 					break;
 				}
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux