Patchwork [iptables-nftables] lixtables: Fixes option issues in libxt_mangle.c

login
register
mail settings
Submitter Tomasz Bursztyka
Date Oct. 3, 2013, 11:28 a.m.
Message ID <1380799685-11091-1-git-send-email-tomasz.bursztyka@linux.intel.com>
Download mbox | patch
Permalink /patch/280268/
State Accepted
Headers show

Comments

Tomasz Bursztyka - Oct. 3, 2013, 11:28 a.m.
- use proper option IDs
- remove irrelevant flags on setting options mandatory

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
---
 extensions/libxt_mangle.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)
Pablo Neira - Oct. 3, 2013, 1 p.m.
On Thu, Oct 03, 2013 at 02:28:05PM +0300, Tomasz Bursztyka wrote:
> - use proper option IDs
> - remove irrelevant flags on setting options mandatory

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

Patch

diff --git a/extensions/libxt_mangle.c b/extensions/libxt_mangle.c
index 822033c..4b20feb 100644
--- a/extensions/libxt_mangle.c
+++ b/extensions/libxt_mangle.c
@@ -33,22 +33,21 @@  static void mangle_help(void)
 	);
 }
 
-#define MANGLE_IPS    '1'
-#define MANGLE_IPT    '2'
-#define MANGLE_DEVS   '3'
-#define MANGLE_DEVT   '4'
-#define MANGLE_TARGET '5'
+enum {
+	MANGLE_IPS    = 0,
+	MANGLE_IPT    = 1,
+	MANGLE_DEVS   = 2,
+	MANGLE_DEVT   = 3,
+	MANGLE_TARGET = 4,
+};
+
 static const struct xt_option_entry mangle_opts[] = {
-	{ .name = "mangle-ip-s", .id = MANGLE_IPS, .type = XTTYPE_STRING,
-	  .flags = XTOPT_MAND },
-	{ .name = "mangle-ip-d", .id = MANGLE_IPT, .type = XTTYPE_STRING,
-	  .flags = XTOPT_MAND },
-	{ .name = "mangle-mac-s", .id = MANGLE_DEVS, .type = XTTYPE_STRING,
-	  .flags = XTOPT_MAND },
-	{ .name = "mangle-mac-d", .id = MANGLE_DEVT, .type = XTTYPE_STRING,
-	  .flags = XTOPT_MAND },
-	{ .name = "mangle-target", .id = MANGLE_TARGET, .type = XTTYPE_STRING,
-	  .flags = XTOPT_MAND },
+	{ .name = "mangle-ip-s", .id = MANGLE_IPS, .type = XTTYPE_STRING },
+	{ .name = "mangle-ip-d", .id = MANGLE_IPT, .type = XTTYPE_STRING },
+	{ .name = "mangle-mac-s", .id = MANGLE_DEVS, .type = XTTYPE_STRING },
+	{ .name = "mangle-mac-d", .id = MANGLE_DEVT, .type = XTTYPE_STRING },
+	{ .name = "mangle-target", .id = MANGLE_TARGET,
+	  .type = XTTYPE_STRING },
 	XTOPT_TABLEEND,
 };