net-firewall/iptables: allow for iptables' module autoload functionality
authorThomas Deutschmann <whissi@gentoo.org>
Sun, 2 Dec 2018 15:46:25 +0000 (16:46 +0100)
committerThomas Deutschmann <whissi@gentoo.org>
Sun, 2 Dec 2018 15:49:19 +0000 (16:49 +0100)
In commit cdc003118830087bbb409761fe4e0e2c19ea103a, a non working check
were fixed. In addition, error handling was added.
However, this introduced a behavior change for users who didn't load
iptables on their own and relied on iptables' own capability to autoload
required modules.

This new revision restores previous behavior and allows for relying on
iptables' module autoload capability again.

Closes: https://bugs.gentoo.org/672366
Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
net-firewall/iptables/files/iptables-r2.init [moved from net-firewall/iptables/files/iptables-r1.init with 93% similarity]
net-firewall/iptables/iptables-1.8.2-r2.ebuild [moved from net-firewall/iptables/iptables-1.8.2-r1.ebuild with 98% similarity]

similarity index 93%
rename from net-firewall/iptables/files/iptables-r1.init
rename to net-firewall/iptables/files/iptables-r2.init
index 708dcce6d3c7f87e5790d6252412298e22b2a9f0..3dcabb0dfb411dffdbb3bab69c820a42e6957160 100755 (executable)
@@ -64,7 +64,6 @@ checkconfig() {
 }
 
 start_pre() {
-       checkkernel || return 1
        checkconfig || return 1
 }
 
@@ -135,7 +134,14 @@ save() {
 }
 
 panic() {
-       checkkernel || return 1
+       # use iptables autoload capability to load at least all required
+       # modules and filter table
+       ${iptables_bin} --wait ${iptables_lock_wait_time} --wait-interval ${iptables_lock_wait_interval} -S >/dev/null
+       if [ $? -ne 0 ] ; then
+               eerror "${iptables_bin} failed to load"
+               return 1
+       fi
+
        if service_started ${iptables_name}; then
                rc-service ${iptables_name} stop
        fi
similarity index 98%
rename from net-firewall/iptables/iptables-1.8.2-r1.ebuild
rename to net-firewall/iptables/iptables-1.8.2-r2.ebuild
index 9279db2ecc56053e62a0d73ec2fa261436dd348d..3a922d3ad650e0f7bd67913fdb68919dae093407 100644 (file)
@@ -98,7 +98,7 @@ src_install() {
        doins include/iptables/internal.h
 
        keepdir /var/lib/iptables
-       newinitd "${FILESDIR}"/${PN}-r1.init iptables
+       newinitd "${FILESDIR}"/${PN}-r2.init iptables
        newconfd "${FILESDIR}"/${PN}-r1.confd iptables
        if use ipv6 ; then
                keepdir /var/lib/ip6tables