From d784db838b183a70bd0041bba5bf297fa5038db3 Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Mon, 23 Apr 2007 18:58:32 +0000 Subject: [PATCH] - fix error when ipv6 support isn't loaded in the kernel (#236888) --- iptables.init | 5 +++++ iptables.spec | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/iptables.init b/iptables.init index bdfa5e2..d808f03 100755 --- a/iptables.init +++ b/iptables.init @@ -28,6 +28,11 @@ if lsmod 2>/dev/null | grep -q ipchains ; then exit 0 fi +# no protocol support, don't try to run +if [ ! -d /proc/sys/net/ipv4 ]; then + exit 0 +fi + # Old or new modutils /sbin/modprobe --version 2>&1 | grep -q module-init-tools \ && NEW_MODUTILS=1 \ diff --git a/iptables.spec b/iptables.spec index 0c300b6..0ccb17b 100644 --- a/iptables.spec +++ b/iptables.spec @@ -3,7 +3,7 @@ Name: iptables Summary: Tools for managing Linux kernel packet filtering capabilities. Version: 1.3.7 -Release: 1.1 +Release: 2 Source: http://www.netfilter.org/%{name}-%{version}.tar.bz2 Source1: iptables.init Source2: iptables-config @@ -95,7 +95,7 @@ cp ip{6,}tables-{save,restore} $RPM_BUILD_ROOT/sbin cp iptables-*.8 $RPM_BUILD_ROOT%{_mandir}/man8 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d install -c -m755 %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/iptables -sed -e 's;iptables;ip6tables;g' -e 's;IPTABLES;IP6TABLES;g' < %{SOURCE1} > ip6tables.init +sed -e 's;iptables;ip6tables;g' -e 's;IPTABLES;IP6TABLES;g' -e 's;/proc/sys/net/ipv4;/proc/sys/net/ipv6;g' < %{SOURCE1} > ip6tables.init install -c -m755 ip6tables.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ip6tables mkdir -p $RPM_BUILD_ROOT/etc/sysconfig install -c -m755 %{SOURCE2} $RPM_BUILD_ROOT/etc/sysconfig/iptables-config @@ -153,6 +153,9 @@ fi %endif %changelog +* Mon Apr 23 2007 Jeremy Katz - 1.3.7-2 +- fix error when ipv6 support isn't loaded in the kernel (#236888) + * Wed Jan 10 2007 Thomas Woerner 1.3.7-1.1 - fixed installation of secmark modules