|
From: Bruce S. <bw...@ar...> - 2004-04-24 00:39:20
|
I upgraded a firewall of mine and all the static route commands bombed.
After a little looking it appeared that the "if" statement below was
backwards, so I swapped the logic. I didn't spend a lot of time looking
at the logic of the code, only the results of my routes (which now work)
I hope I didn't screw it up too bad, Friedrich! :-)
- BS
> Log Message:
> Fix static routes with full subnet mask not working.
>
>
> Index: network
> ===================================================================
> RCS file: /cvsroot/devil-linux/build/config/etc/init.d/network,v
> retrieving revision 1.31
> retrieving revision 1.32
> diff -u -d -r1.31 -r1.32
> --- network 10 Apr 2004 00:14:49 -0000 1.31
> +++ network 23 Apr 2004 21:12:40 -0000 1.32
> @@ -263,7 +263,7 @@
> fi
>
> # add the route
> - if [ -n "${netmask##*.*}" ]; then
> + if [ -z "${netmask##*.*}" ]; then
> echo " adding route to $CMD ${target}${netmask:+/$netmask}${gateway:+ via gateway $gateway} on $DEVICE"
> route add -$CMD ${target} ${netmask:+netmask $netmask} ${gateway:+gw $gateway} dev $DEVICE
> else
|
|
From: Tim T. <t....@co...> - 2004-04-27 01:26:10
|
Bruce Smith wrote:
>>>I upgraded a firewall of mine and all the static route commands bombed.
>>>After a little looking it appeared that the "if" statement below was
>>>backwards, so I swapped the logic. I didn't spend a lot of time looking
>>>at the logic of the code, only the results of my routes (which now work)
>>>I hope I didn't screw it up too bad, Friedrich! :-)
>>>
>>>
>>What does your routing entry look like? Would be good to know that as the
>>code that you "fixed" looked ok to me - but I did not dig deeper into the
>>matter.
>>
>>
>
>ifcfg-eth0:
>ROUTE="$ROUTE 192.168.2.0/255.255.255.0:172.16.254.1"
>
>ifcfg-eth1:
>ROUTE="$ROUTE default/0.0.0.0:10.18.12.19"
>
>(some public IP's changed to protect the innocent :)
>
>
>
>>>> # add the route
>>>>- if [ -n "${netmask##*.*}" ]; then
>>>>+ if [ -z "${netmask##*.*}" ]; then
>>>> echo " adding route to $CMD ${target}${netmask:+/$netmask}${gateway:+ via gateway $gateway} on $DEVICE"
>>>> route add -$CMD ${target} ${netmask:+netmask $netmask} ${gateway:+gw $gateway} dev $DEVICE
>>>> else
>>>>
>>>>
>>This line was obviously from a patch from "Cameron Miller".
>>http://cvs.sourceforge.net/viewcvs.py/devil-linux/build/config/etc/init.d/network?r1=1.28&r2=1.29
>>and
>>http://cvs.sourceforge.net/viewcvs.py/devil-linux/build/config/etc/init.d/network
>>
>>
>
>OK. I just remembered you committing some changes recently.
>I didn't remember (or lookup) where they came from.
>
> - BS
>
This one got me too... has it been fixed yet? I don't see it when I do a
cvs diff...
Tim
|
|
From: Bruce S. <bw...@ar...> - 2004-04-27 01:37:36
|
> > > > I upgraded a firewall of mine and all the static route commands bombed.
> > > > After a little looking it appeared that the "if" statement below was
> > > > backwards, so I swapped the logic. I didn't spend a lot of time looking
> > > > at the logic of the code, only the results of my routes (which now work)
> > > > I hope I didn't screw it up too bad, Friedrich! :-)
> > > >
> >
> > > > > # add the route
> > > > > - if [ -n "${netmask##*.*}" ]; then
> > > > > + if [ -z "${netmask##*.*}" ]; then
> > > > > echo " adding route to $CMD ${target}${netmask:+/$netmask}${gateway:+ via gateway $gateway} on $DEVICE"
> > > > > route add -$CMD ${target} ${netmask:+netmask $netmask} ${gateway:+gw $gateway} dev $DEVICE
> > > > > else
> > > > >
Yeah, I committed the change last Friday. I upgraded a couple servers
today to the latest, and it works for me now.
What revision number are you showing for the script? Sometimes
sourceforge's anon CVS servers a little behind. It should be 1.32.
Otherwise, it's a one character change you can do manually on line 266,
see above.
- BS
|
|
From: Friedrich L. <fl...@fl...> - 2004-04-24 00:48:28
|
Bruce Smith wrote on 24.04.2004 02:39 MET:
> I upgraded a firewall of mine and all the static route commands bombed.
> After a little looking it appeared that the "if" statement below was
> backwards, so I swapped the logic. I didn't spend a lot of time looking
> at the logic of the code, only the results of my routes (which now work)
> I hope I didn't screw it up too bad, Friedrich! :-)
What does your routing entry look like? Would be good to know that as the
code that you "fixed" looked ok to me - but I did not dig deeper into the
matter.
>>Log Message:
>>Fix static routes with full subnet mask not working.
>>
>>
>>Index: network
>>===================================================================
>>RCS file: /cvsroot/devil-linux/build/config/etc/init.d/network,v
>>retrieving revision 1.31
>>retrieving revision 1.32
>>diff -u -d -r1.31 -r1.32
>>--- network 10 Apr 2004 00:14:49 -0000 1.31
>>+++ network 23 Apr 2004 21:12:40 -0000 1.32
>>@@ -263,7 +263,7 @@
>> fi
>>
>> # add the route
>>- if [ -n "${netmask##*.*}" ]; then
>>+ if [ -z "${netmask##*.*}" ]; then
>> echo " adding route to $CMD ${target}${netmask:+/$netmask}${gateway:+ via gateway $gateway} on $DEVICE"
>> route add -$CMD ${target} ${netmask:+netmask $netmask} ${gateway:+gw $gateway} dev $DEVICE
>> else
This line was obviously from a patch from "Cameron Miller".
http://cvs.sourceforge.net/viewcvs.py/devil-linux/build/config/etc/init.d/network?r1=1.28&r2=1.29
and
http://cvs.sourceforge.net/viewcvs.py/devil-linux/build/config/etc/init.d/network
--
MfG / Regards
Friedrich Lobenstock
____________________________________________________________________
Friedrich Lobenstock Linux Services Lobenstock
URL: http://www.lsl.at/ Email: fl...@fl...
____________________________________________________________________
|
|
From: Bruce S. <bw...@ar...> - 2004-04-24 01:43:58
|
> > I upgraded a firewall of mine and all the static route commands bombed.
> > After a little looking it appeared that the "if" statement below was
> > backwards, so I swapped the logic. I didn't spend a lot of time looking
> > at the logic of the code, only the results of my routes (which now work)
> > I hope I didn't screw it up too bad, Friedrich! :-)
>
> What does your routing entry look like? Would be good to know that as the
> code that you "fixed" looked ok to me - but I did not dig deeper into the
> matter.
ifcfg-eth0:
ROUTE="$ROUTE 192.168.2.0/255.255.255.0:172.16.254.1"
ifcfg-eth1:
ROUTE="$ROUTE default/0.0.0.0:10.18.12.19"
(some public IP's changed to protect the innocent :)
> >> # add the route
> >>- if [ -n "${netmask##*.*}" ]; then
> >>+ if [ -z "${netmask##*.*}" ]; then
> >> echo " adding route to $CMD ${target}${netmask:+/$netmask}${gateway:+ via gateway $gateway} on $DEVICE"
> >> route add -$CMD ${target} ${netmask:+netmask $netmask} ${gateway:+gw $gateway} dev $DEVICE
> >> else
>
> This line was obviously from a patch from "Cameron Miller".
> http://cvs.sourceforge.net/viewcvs.py/devil-linux/build/config/etc/init.d/network?r1=1.28&r2=1.29
> and
> http://cvs.sourceforge.net/viewcvs.py/devil-linux/build/config/etc/init.d/network
OK. I just remembered you committing some changes recently.
I didn't remember (or lookup) where they came from.
- BS
|