Bug 22643 - ipchains init script fails in kernel 2.4
Summary: ipchains init script fails in kernel 2.4
Keywords:
Status: CLOSED DUPLICATE of bug 22612
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: ipchains
Version: 7.0
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: Mike A. Harris
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-12-21 03:52 UTC by Glen Turner
Modified: 2005-10-31 22:00 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2000-12-21 03:52:31 UTC
Embargoed:


Attachments (Terms of Use)

Description Glen Turner 2000-12-21 03:52:29 UTC
The init script /etc/rc.d/init.d/ipchains fails when Linux 2.4 is compiled
with legacy support for ipchains as a module.

$ uname -r
2.4.0-test12pre5-mpls0.700-gdt16

$ rpm -q ipchains
ipchains-1.3.10-1

The following code explicitly loads the module if it is required.

$ cd /etc/rc.d/init.d
$ rcsdiff -r1.1 -c ipchains
===================================================================
RCS file: RCS/ipchains,v
retrieving revision 1.1
diff -c -r1.1 ipchains
*** ipchains	2000/12/19 12:35:13	1.1
--- ipchains	2000/12/19 12:52:09
***************
*** 8,13 ****
--- 8,14 ----
  #
  # Script Author:	Joshua Jensen <joshua>
  #   -- hacked up by gafton with help from notting
+ #   -- modified for Linux 2.4 by glen.turner+linux.au
  #
  # config: /etc/sysconfig/ipchains
  
***************
*** 29,39 ****
--- 30,49 ----
  if [ "$KERNELMAJ" -eq 2 -a "$KERNELMIN" -lt 2 ] ; then
  	exit 0
  fi
+ if [ "$KERNELMAJ" -eq 2 -a "$KERNELMIN" -ge 4 ] ; then
+ 	# Linux 2.4 doesn't use IP chains, backward compatibility
+ 	# is provided with a module.
+ 	MODULAR="y"
+ fi
  
  case "$1" in
    start)
  	# don't do squat if we don't have the config file
  	if [ -f $IPCHAINS_CONFIG ]; then
+ 	    # Install module if needed
+ 	    [ "$MODULAR" == "y" ] && 
+ 	  	action "Installing IP chains kernel module:" modprobe ipchains
+ 
  	    # If we don't clear these first, we might be adding to
  	    #  pre-existing rules.
  	    action "Flushing all current rules and user defined chains:"
ipchains -F
***************
*** 58,63 ****
--- 68,76 ----
  	  success "Resetting built-in chains to the default ACCEPT policy" || \
  	  failure "Resetting built-in chains to the default ACCEPT policy"
  	echo
+ 	# Remove module if installed
+ 	[ "$MODULAR" == "y" ] && 
+ 	    action "Removing IP chains kernel module:" rmmod ipchains
  	rm -f /var/lock/subsys/ipchains
  	;;

Comment 1 Bill Nottingham 2000-12-21 03:53:14 UTC

*** This bug has been marked as a duplicate of 22612 ***


Note You need to log in before you can comment on or make changes to this bug.