Skip to content

Commit 61e1f39

Browse files
Revert "iptables: Enable nftables (#10786)" (#10814)
1 parent a1bad82 commit 61e1f39

2 files changed

Lines changed: 13 additions & 64 deletions

File tree

SPECS/ebtables/ebtables.spec

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Name: ebtables
44
Version: 2.0.11
5-
Release: 9%{?dist}
5+
Release: 8%{?dist}
66
Summary: Ethernet Bridge frame table administration tool
77
License: GPLv2+
88
URL: http://ebtables.sourceforge.net/
@@ -35,9 +35,6 @@ like iptables. There are no known incompatibility issues.
3535

3636
%package legacy
3737
Summary: Legacy user space tool to configure bridge netfilter rules in kernel
38-
Requires(post): %{_sbindir}/update-alternatives
39-
Requires(post): %{_bindir}/readlink
40-
Requires(postun): %{_sbindir}/update-alternatives
4138
Provides: ebtables
4239

4340
%description legacy
@@ -93,22 +90,10 @@ rm %{buildroot}/%{_libdir}/libebtc.la
9390
# Drop these binaries (for now at least)
9491
rm %{buildroot}/%{_sbindir}/ebtables{d,u}
9592

96-
# Prepare for Alternatives system
97-
touch %{buildroot}%{_sbindir}/ebtables
98-
touch %{buildroot}%{_sbindir}/ebtables-save
99-
touch %{buildroot}%{_sbindir}/ebtables-restore
100-
101-
%post legacy
102-
pfx=%{_sbindir}/ebtables
103-
%{_sbindir}/update-alternatives --install %{_sbindir}/%{name} %{name} %{_sbindir}/%{name}-legacy 10000 \
104-
--slave %{_sbindir}/%{name}-save %{name}-save %{_sbindir}/%{name}-legacy-save \
105-
--slave %{_sbindir}/%{name}-restore %{name}-restore %{_sbindir}/%{name}-legacy-restore
106-
107-
%postun legacy
108-
if [ $1 -eq 0 ]; then
109-
%{_sbindir}/update-alternatives --remove \
110-
%{name} %{_sbindir}/%{name}-legacy
111-
fi
93+
# Symlink ebtables-legacy to ebtables
94+
ln -sf ebtables-legacy %{buildroot}%{_sbindir}/ebtables
95+
ln -sf ebtables-legacy-save %{buildroot}%{_sbindir}/ebtables-save
96+
ln -sf ebtables-legacy-restore %{buildroot}%{_sbindir}/ebtables-restore
11297

11398
%post services
11499
%systemd_post ebtables.service
@@ -123,10 +108,10 @@ fi
123108
%license COPYING
124109
%doc ChangeLog THANKS
125110
%{_sbindir}/ebtables-legacy*
111+
%{_sbindir}/ebtables*
126112
%{_mandir}/*/ebtables-legacy*
127113
%{_libdir}/libebtc.so*
128114
%{_sysconfdir}/ethertypes
129-
%ghost %{_sbindir}/ebtables{,-save,-restore}
130115

131116
%files services
132117
%{_unitdir}/ebtables.service
@@ -135,9 +120,6 @@ fi
135120
%ghost %{_sysconfdir}/sysconfig/ebtables
136121

137122
%changelog
138-
* Mon Oct 21 2024 Sumedh Sharma <sumsharma@microsoft.com> - 2.0.11-9
139-
- introduce alternatives for legacy
140-
141123
* Tue Sep 03 2024 Neha Agarwal <nehaagarwal@microsoft.com> - 2.0.11-8
142124
- Add missing Vendor and Distribution tags.
143125

SPECS/iptables/iptables.spec

Lines changed: 7 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Linux kernel packet control tool
22
Name: iptables
33
Version: 1.8.10
4-
Release: 3%{?dist}
4+
Release: 2%{?dist}
55
License: GPLv2+
66
Vendor: Microsoft Corporation
77
Distribution: Azure Linux
@@ -43,14 +43,15 @@ It contains the libraries and header files to create applications.
4343
--exec-prefix= \
4444
--with-xtlibdir=%{_libdir}/iptables \
4545
--with-pkgconfigdir=%{_libdir}/pkgconfig \
46+
--disable-nftables \
4647
--enable-libipq \
4748
--enable-devel
4849

49-
%make_build
50+
make V=0
5051

5152
%install
5253
%make_install
53-
54+
ln -sfv ../../sbin/xtables-multi %{buildroot}%{_libdir}/iptables-xml
5455
# Install daemon scripts
5556
install -vdm755 %{buildroot}%{_unitdir}
5657
install -m 644 %{SOURCE1} %{buildroot}%{_unitdir}
@@ -64,42 +65,14 @@ find %{buildroot} -name '*.a' -delete
6465
find %{buildroot} -type f -name "*.la" -delete -print
6566
%{_fixperms} %{buildroot}/*
6667

67-
ln -sf --relative %{buildroot}%{_sbindir}/xtables-legacy-multi %{buildroot}%{_bindir}/iptables-xml
68+
%preun
69+
%systemd_preun iptables.service
6870

6971
%post
70-
for target in %{name} \
71-
ip6tables \
72-
ebtables \
73-
arptables; do
74-
alternatives --install %{_sbindir}/${target} ${target} %{_sbindir}/${target}-nft 30000 \
75-
--slave %{_sbindir}/${target}-save ${target}-save %{_sbindir}/${target}-nft-save \
76-
--slave %{_sbindir}/${target}-restore ${target}-restore %{_sbindir}/${target}-nft-restore
77-
done
78-
79-
for target in %{name} \
80-
ip6tables; do
81-
alternatives --install %{_sbindir}/${target} ${target} %{_sbindir}/${target}-legacy 10000 \
82-
--slave %{_sbindir}/${target}-save ${target}-save %{_sbindir}/${target}-legacy-save \
83-
--slave %{_sbindir}/${target}-restore ${target}-restore %{_sbindir}/${target}-legacy-restore
84-
done
85-
8672
/sbin/ldconfig
8773
%systemd_post iptables.service
8874

89-
%preun
90-
%systemd_preun iptables.service
91-
9275
%postun
93-
if [ $1 -eq 0 ]; then
94-
for target in %{name} \
95-
ip6tables \
96-
ebtables \
97-
arptables; do
98-
alternatives --remove ${target} %{_sbindir}/${target}-nft
99-
done
100-
alternatives --remove %{name} %{_sbindir}/%{name}-legacy
101-
alternatives --remove ip6tables %{_sbindir}/ip6tables-legacy
102-
fi
10376
/sbin/ldconfig
10477
%systemd_postun_with_restart iptables.service
10578

@@ -110,18 +83,15 @@ fi
11083
%config(noreplace) %{_sysconfdir}/systemd/scripts/iptables.stop
11184
%config(noreplace) %{_sysconfdir}/systemd/scripts/ip4save
11285
%config(noreplace) %{_sysconfdir}/systemd/scripts/ip6save
113-
%config(noreplace) %{_sysconfdir}/ethertypes
11486
%{_unitdir}/iptables.service
11587
%{_sbindir}/*
11688
%{_bindir}/*
11789
%{_libdir}/*.so.*
11890
%{_libdir}/iptables/*
119-
%{_bindir}/iptables-xml
91+
%{_libdir}/iptables-xml
12092
%{_mandir}/man1/*
12193
%{_mandir}/man8/*
12294
/usr/share/xtables/iptables.xslt
123-
%ghost %{_sbindir}/ip{,6}tables{,-save,-restore}
124-
%ghost %{_sbindir}/{eb,arp}tables{,-save,-restore}
12595

12696
%files devel
12797
%{_libdir}/*.so
@@ -130,9 +100,6 @@ fi
130100
%{_mandir}/man3/*
131101

132102
%changelog
133-
* Fri Oct 18 2024 Sumedh Sharma <sumsharma@microsoft.com> - 1.8.10-3
134-
- Enable nftables and use alternatives.
135-
136103
* Mon Mar 18 2024 Andy Zaugg <azaugg@linkedin.com> - 1.8.10-2
137104
- Flush raw table when restarting iptables service
138105

0 commit comments

Comments
 (0)