This was the only reason we required the iptables and ebtables
packages at build time, and many other external commands already have
their binaries found at runtime by looking through $PATH (virCommand
automatically does this), so we may as well do it for these commands
as well.
Since we no longer need iptables or iptables at build time, we can
also drop the BuildRequires for them from the rpm specfile.
Inspired-by: 6aa2fa38b04b802f137e51ebbeb4ca9b67487575
Signed-off-by: Laine Stump <laine(a)redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange(a)redhat.com>
---
Change from V2:
* This was 2 patches in V2 (22 & 23), combined here.
libvirt.spec.in | 2 --
meson.build | 3 ---
src/network/bridge_driver_conf.c | 2 ++
src/util/virfirewall.h | 5 +++++
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/libvirt.spec.in b/libvirt.spec.in
index bde25c6f6e..05f7a7e7c0 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -356,8 +356,6 @@ BuildRequires: sanlock-devel >= 2.4
BuildRequires: libpcap-devel >= 1.5.0
BuildRequires: libnl3-devel
BuildRequires: libselinux-devel
-BuildRequires: iptables
-BuildRequires: ebtables
# For modprobe
BuildRequires: kmod
BuildRequires: cyrus-sasl-devel
diff --git a/meson.build b/meson.build
index 02340c09dd..b9379d6ce7 100644
--- a/meson.build
+++ b/meson.build
@@ -818,10 +818,7 @@ optional_test_programs = [
optional_programs = [
'dmidecode',
- 'ebtables',
'ip',
- 'ip6tables',
- 'iptables',
'iscsiadm',
'mdevctl',
'mm-ctl',
diff --git a/src/network/bridge_driver_conf.c b/src/network/bridge_driver_conf.c
index 25cbbf8933..e8acb70554 100644
--- a/src/network/bridge_driver_conf.c
+++ b/src/network/bridge_driver_conf.c
@@ -27,8 +27,10 @@
#include "virerror.h"
#include "virfile.h"
#include "virutil.h"
+#include "virfirewall.h" /* for binary names */
#include "bridge_driver_conf.h"
+
#define VIR_FROM_THIS VIR_FROM_NETWORK
VIR_LOG_INIT("network.bridge_driver");
diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h
index 917745c315..4ac16f02b3 100644
--- a/src/util/virfirewall.h
+++ b/src/util/virfirewall.h
@@ -25,6 +25,11 @@
#include "virbuffer.h"
#include "virxml.h"
+/* various external programs executed when applying firewalls */
+#define EBTABLES "ebtables"
+#define IPTABLES "iptables"
+#define IP6TABLES "ip6tables"
+
typedef struct _virFirewall virFirewall;
typedef struct _virFirewallCmd virFirewallCmd;
--
2.44.0