From 7e763c5275635ffc1849da86934aedbc496c6cd3 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 14 May 2025 15:35:01 +0200 Subject: [PATCH] nwfilter: Fix return type of virNWFilterCanApplyBasicRules callback The virNWFilterCanApplyBasicRules() callback returns an int but in fact its return type is a boolean. Even its only implementation (ebiptablesCanApplyBasicRules()) returns a boolean. Switch the return type from integer to boolean. Signed-off-by: Michal Privoznik Reviewed-by: Peter Krempa --- src/nwfilter/nwfilter_ebiptables_driver.c | 2 +- src/nwfilter/nwfilter_tech_driver.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nwfilter/nwfilter_ebiptables_driver.c b/src/nwfilter/nwfilter_ebiptables_driver.c index 5082b62577..067df6e612 100644 --- a/src/nwfilter/nwfilter_ebiptables_driver.c +++ b/src/nwfilter/nwfilter_ebiptables_driver.c @@ -2797,7 +2797,7 @@ ebtablesRenameTmpSubAndRootChainsFW(virFirewall *fw, * run ebtablesApplyBasicRules and ebtablesApplyDHCPOnlyRules. * In case of this driver we need the ebtables tool available. */ -static int +static bool ebiptablesCanApplyBasicRules(void) { return true; diff --git a/src/nwfilter/nwfilter_tech_driver.h b/src/nwfilter/nwfilter_tech_driver.h index 8de9eda947..a4af0bf6d5 100644 --- a/src/nwfilter/nwfilter_tech_driver.h +++ b/src/nwfilter/nwfilter_tech_driver.h @@ -51,7 +51,7 @@ typedef int (*virNWFilterRuleTeardownOldRules)(const char *ifname); typedef int (*virNWFilterRuleAllTeardown)(const char *ifname); -typedef int (*virNWFilterCanApplyBasicRules)(void); +typedef bool (*virNWFilterCanApplyBasicRules)(void); typedef int (*virNWFilterApplyBasicRules)(const char *ifname, const virMacAddr *macaddr); -- 2.47.2