[PATCH 3/5] ipset: coalesce two ifs

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

 



Because they are doing the same for both IPSET_CMD_LIST and
IPSET_CMD_SAVE.

Signed-off-by: Holger Eitzenberger <holger@xxxxxxxxxxxxxxxx>
---
 lib/session.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/session.c b/lib/session.c
index 7a719b2..d4fe836 100644
--- a/lib/session.c
+++ b/lib/session.c
@@ -1936,13 +1936,11 @@ ipset_cmd(struct ipset_session *session, enum ipset_cmd cmd, uint32_t lineno)
 	session->lineno = lineno;
 
 	/* Set default output mode */
-	if (cmd == IPSET_CMD_LIST) {
+	if (cmd == IPSET_CMD_LIST || cmd == IPSET_CMD_SAVE) {
 		if (session->mode == IPSET_LIST_NONE)
 			session->mode = IPSET_LIST_PLAIN;
-	} else if (cmd == IPSET_CMD_SAVE) {
-		if (session->mode == IPSET_LIST_NONE)
-			session->mode = IPSET_LIST_SAVE;
 	}
+
 	/* Start the root element in XML mode */
 	if ((cmd == IPSET_CMD_LIST || cmd == IPSET_CMD_SAVE) &&
 	    session->mode == IPSET_LIST_XML)

--
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