From ad668b98e92c42a644e7353d1320293806863e97 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Wed, 24 Jun 2020 15:56:43 -0400 Subject: [PATCH] nwfilter: define a typedef for struct ebtablesSubChainInst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Laine Stump Reviewed-by: Ján Tomko --- src/nwfilter/nwfilter_ebiptables_driver.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index 426212e0dc..cc0f3f93d9 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -3269,7 +3269,9 @@ ebtablesRuleInstCommand(virFirewallPtr fw, return ret; } -struct ebtablesSubChainInst { +typedef struct _ebtablesSubChainInst ebtablesSubChainInst; +typedef ebtablesSubChainInst *ebtablesSubChainInstPtr; +struct _ebtablesSubChainInst { virNWFilterChainPriority priority; bool incoming; enum l3_proto_idx protoidx; @@ -3280,8 +3282,8 @@ struct ebtablesSubChainInst { static int ebtablesSubChainInstSort(const void *a, const void *b) { - const struct ebtablesSubChainInst **insta = (const struct ebtablesSubChainInst **)a; - const struct ebtablesSubChainInst **instb = (const struct ebtablesSubChainInst **)b; + const ebtablesSubChainInst **insta = (const ebtablesSubChainInst **)a; + const ebtablesSubChainInst **instb = (const ebtablesSubChainInst **)b; /* priorities are limited to range [-1000, 1000] */ return (*insta)->priority - (*instb)->priority; @@ -3291,7 +3293,7 @@ ebtablesSubChainInstSort(const void *a, const void *b) static int ebtablesGetSubChainInsts(virHashTablePtr chains, bool incoming, - struct ebtablesSubChainInst ***insts, + ebtablesSubChainInstPtr **insts, size_t *ninsts) { virHashKeyValuePairPtr filter_names; @@ -3304,7 +3306,7 @@ ebtablesGetSubChainInsts(virHashTablePtr chains, return -1; for (i = 0; filter_names[i].key; i++) { - struct ebtablesSubChainInst *inst; + ebtablesSubChainInstPtr inst; enum l3_proto_idx idx = ebtablesGetProtoIdxByFiltername( filter_names[i].key); @@ -3344,7 +3346,7 @@ ebiptablesApplyNewRules(const char *ifname, bool haveEbtables = false; bool haveIptables = false; bool haveIp6tables = false; - struct ebtablesSubChainInst **subchains = NULL; + ebtablesSubChainInstPtr *subchains = NULL; size_t nsubchains = 0; int ret = -1;