On Dec 19, 2005, at 9:10 AM, Xun Sun wrote:
On 12/19/05, Andrew Beekhof <[EMAIL PROTECTED]> wrote:
On Dec 17, 2005, at 4:21 PM, Xun Sun wrote:
On 12/16/05, Andrew Beekhof <[EMAIL PROTECTED]> wrote:
I'm no expert, but resources/OCF/IPaddr.in looks broken to me.
The first is this conditional which looks new:
if [ ! -z "$OCF_RESKEY_netmask" ]; then
NICINFO=`$FINDIF "$BASEIP/$NETMASK/$NIC/$BRDCAST"`
else
NICINFO=`$FINDIF "$BASEIP"`
fi
This makes no sense as the next line is:
NICINFO=`$FINDIF "$BASEIP/$NETMASK/$NIC/$BRDCAST"`
So this line is redundant.
I also believe these lines require a -C argument so that when the
netmask is parsed and fed back into $FINDIF later, $FINDIF doesn't
barf.
The $NETMASK is not used to feed $FINDIF,
but it should be.
But why?
So the original script proceeded like this
if [ ! -z "$OCF_RESKEY_netmask" ]; then
NICINFO=`$FINDIF "$BASEIP/$OCF_RESKEY_netmask/$NIC/
$BRDCAST"`
else
NICINFO=`$FINDIF "$BASEIP"`
fi
NETMASK=`cut -f2 $NICINFO`
From this point on, we have two netmask arguments,
$OCF_RESKEY_netmask
in CIDR format and $NETAMSK in dotted quad format with the "netmask"
literal, the former one to feed $FINDIF, the latter one to feed
$IFCONFIG.
Makes sense?
no - see my other email - because the netmask is never used.
there is also no need to calculate the other form.
i will have a patch later today.
i will be taking an extensive look at IPaddr today
it is for ifconfig (ifconfig
does not expect CIDR netmask format?). Maybe this is not a clear
way,
but it is the way it has been working before I came to know Linux-
HA.
The reason $FINDIF doesn't barf now is that the calculated
netmask is
never used. This too is fixed in the attached patch.
I have also included some code to make the parsing of $FINDIF
output
work on Darwin.
Possibly its broken on other platforms too.
Permission to apply?
--
Andrew Beekhof
"Would the last person to leave please turn out the
enlightenment?" -
TISM
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
--
Thanks & regards
Xun Sun
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
--
Andrew Beekhof
"Ooo Ahhh, Glenn McRath" - TISM
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
--
Thanks & regards
Xun Sun
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
--
Andrew Beekhof
"Would the last person to leave please turn out the enlightenment?" -
TISM
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/