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