Blame SOURCES/extensions-Fix-ipvs-vproto-parsing.patch

9a3fa7
From dab2ab10ed0cb30fb454097200f440660a0f3946 Mon Sep 17 00:00:00 2001
9a3fa7
From: Phil Sutter <psutter@redhat.com>
9a3fa7
Date: Wed, 3 Apr 2019 20:19:53 +0200
9a3fa7
Subject: [PATCH] extensions: Fix ipvs vproto parsing
9a3fa7
9a3fa7
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1679726
9a3fa7
Upstream Status: iptables commit fcbdc69e8a750
9a3fa7
9a3fa7
commit fcbdc69e8a750fe02c9d7c7aced0efc91715132d
9a3fa7
Author: Phil Sutter <phil@nwl.cc>
9a3fa7
Date:   Thu Feb 21 20:09:30 2019 +0100
9a3fa7
9a3fa7
    extensions: Fix ipvs vproto parsing
9a3fa7
9a3fa7
    This was broken by integration into guided option parser:
9a3fa7
9a3fa7
    * Make 'vproto' option XTTYPE_PROTOCOL, otherwise its arguments are
9a3fa7
      parsed as garbage only.
9a3fa7
9a3fa7
    * Drop O_VPROTO case from ipvs_mt_parse(), due to XTOPT_POINTER() and
9a3fa7
      above change there is nothing to do for it in there.
9a3fa7
9a3fa7
    Fixes: 372203af4c70f ("libxt_ipvs: use guided option parser")
9a3fa7
    Signed-off-by: Phil Sutter <phil@nwl.cc>
9a3fa7
    Signed-off-by: Florian Westphal <fw@strlen.de>
9a3fa7
9a3fa7
Signed-off-by: Phil Sutter <psutter@redhat.com>
9a3fa7
---
9a3fa7
 extensions/libxt_ipvs.c | 5 +----
9a3fa7
 1 file changed, 1 insertion(+), 4 deletions(-)
9a3fa7
9a3fa7
diff --git a/extensions/libxt_ipvs.c b/extensions/libxt_ipvs.c
9a3fa7
index a6c57a030d2c6..fe98fef951686 100644
9a3fa7
--- a/extensions/libxt_ipvs.c
9a3fa7
+++ b/extensions/libxt_ipvs.c
9a3fa7
@@ -27,7 +27,7 @@ enum {
9a3fa7
 static const struct xt_option_entry ipvs_mt_opts[] = {
9a3fa7
 	{.name = "ipvs", .id = O_IPVS, .type = XTTYPE_NONE,
9a3fa7
 	 .flags = XTOPT_INVERT},
9a3fa7
-	{.name = "vproto", .id = O_VPROTO, .type = XTTYPE_STRING,
9a3fa7
+	{.name = "vproto", .id = O_VPROTO, .type = XTTYPE_PROTOCOL,
9a3fa7
 	 .flags = XTOPT_INVERT | XTOPT_PUT, XTOPT_POINTER(s, l4proto)},
9a3fa7
 	{.name = "vaddr", .id = O_VADDR, .type = XTTYPE_HOSTMASK,
9a3fa7
 	 .flags = XTOPT_INVERT},
9a3fa7
@@ -69,9 +69,6 @@ static void ipvs_mt_parse(struct xt_option_call *cb)
9a3fa7
 
9a3fa7
 	xtables_option_parse(cb);
9a3fa7
 	switch (cb->entry->id) {
9a3fa7
-	case O_VPROTO:
9a3fa7
-		data->l4proto = cb->val.protocol;
9a3fa7
-		break;
9a3fa7
 	case O_VADDR:
9a3fa7
 		memcpy(&data->vaddr, &cb->val.haddr, sizeof(cb->val.haddr));
9a3fa7
 		memcpy(&data->vmask, &cb->val.hmask, sizeof(cb->val.hmask));
9a3fa7
-- 
9a3fa7
2.21.0
9a3fa7