From: Michal Privoznik Date: Wed, 14 May 2025 13:35:01 +0000 (+0200) Subject: nwfilter: Fix return type of virNWFilterCanApplyBasicRules callback X-Git-Tag: v11.4.0-rc1~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e763c5275635ffc1849da86934aedbc496c6cd3;p=thirdparty%2Flibvirt.git 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 --- 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);