From: Gilles E. <ges...@us...> - 2005-10-25 23:56:16
|
Update of /cvsroot/ipcop/ipcop/src/rc.d In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv948/src/rc.d Modified Files: Tag: IPCOP_v1_4_0 rc.red Log Message: Fix routed ip start with llc encap (thank to Filippo Carltetti) Fix routed ip stop (tested with vc encap) - can't add a separate 2>/dev/null with atmarp, it need to be in the same string - unload clip module only on full cleanup and not simply stop (I had many oops related to clip loading again) Index: rc.red =================================================================== RCS file: /cvsroot/ipcop/ipcop/src/rc.d/Attic/rc.red,v retrieving revision 1.29.2.54 retrieving revision 1.29.2.55 diff -C2 -d -r1.29.2.54 -r1.29.2.55 *** rc.red 28 Jul 2005 16:47:44 -0000 1.29.2.54 --- rc.red 25 Oct 2005 23:56:01 -0000 1.29.2.55 *************** *** 75,78 **** --- 75,79 ---- system('/bin/killall /usr/bin/br2684ctl 2>/dev/null'); system('/sbin/modprobe', '-r', 'br2684'); + system('/sbin/modprobe', '-r', 'clip'); if ($pppsettings{'TYPE'} ne '3cp4218usbadsl') { system('/sbin/modprobe', '-r', '3cp4218');} *************** *** 299,306 **** if (!system ('/bin/ps -ef | /bin/grep -q [a]tmarpd')) { if ($pppsettings{'GATEWAY'} ne '') { ! system('/usr/sbin/atmarp', '-d', $pppsettings{'GATEWAY'}, '2>/dev/null'); } system('/bin/killall /usr/sbin/atmarpd 2>/dev/null'); system ('/sbin/ifconfig', 'atm0', 'down'); - system('/sbin/modprobe', '-r', 'clip'); } --- 300,306 ---- if (!system ('/bin/ps -ef | /bin/grep -q [a]tmarpd')) { if ($pppsettings{'GATEWAY'} ne '') { ! system("/usr/sbin/atmarp -d $pppsettings{'GATEWAY'} 2>/dev/null"); } system('/bin/killall /usr/sbin/atmarpd 2>/dev/null'); system ('/sbin/ifconfig', 'atm0', 'down'); } *************** *** 1139,1143 **** $iface = "atm$itf"; if (open(FILE, ">${General::swroot}/red/iface")) { print FILE $iface; close FILE; } - if ($pppsettings{'ENCAP'} eq '2') { $ENCAP=''; } else { $ENCAP='null'; } if (system ('/bin/ps -ef | /bin/grep -q [a]tmarpd')) { if (system ('/usr/sbin/atmarpd -b -l syslog')) { --- 1139,1142 ---- *************** *** 1145,1152 **** exit 1; } ! if (system ("/usr/sbin/atmarp -c $iface")) { ! &General::log("creation of $iface fail"); ! exit 1; ! } if ($pppsettings{'METHOD'} eq 'STATIC') { my @staticcommand = ('/sbin/ifconfig'); --- 1144,1150 ---- exit 1; } ! # it will fail on all attempt after the first because interface still exist ! system ("/usr/sbin/atmarp -c $iface 2>/dev/null"); ! if ($pppsettings{'METHOD'} eq 'STATIC') { my @staticcommand = ('/sbin/ifconfig'); *************** *** 1158,1162 **** # we have to wait a bit before launching atmarp -s sleep 2; ! system ('/usr/sbin/atmarp', '-s', $pppsettings{'GATEWAY'},"$itf.$pppsettings{'VPI'}.$pppsettings{'VCI'}", $ENCAP); system ("/sbin/route", "add", "default", "gw", $pppsettings{'GATEWAY'}); system ("/bin/touch", "${General::swroot}/red/active"); --- 1156,1164 ---- # we have to wait a bit before launching atmarp -s sleep 2; ! my @atmarp = ('/usr/sbin/atmarp', '-s', $pppsettings{'GATEWAY'}, "$itf.$pppsettings{'VPI'}.$pppsettings{'VCI'}"); ! if ($pppsettings{'ENCAP'} eq '3') { ! push(@atmarp, 'null' ); # routed ip vc encap ! } ! system (@atmarp); system ("/sbin/route", "add", "default", "gw", $pppsettings{'GATEWAY'}); system ("/bin/touch", "${General::swroot}/red/active"); |