On Thu, 20 Apr 2006, David Lee wrote:
> On Wed, 19 Apr 2006, Alan Robertson wrote:
>
> > David Lee wrote:
> > > [...]
> > > So the question is what _should_ be happening here? Is the ":1" in the
> > > invocation correct, or tolerable, or incorrect? Should that ":1" be in
> > > the "findif" invocation at all? If it is invoked with ":1" nomenclature,
> > > what _should_ "findif" do when "le0" exists, but the ":1" variant doesn't?
> > >
> > > Put another way: is the wrong behaviour somehow (how?) within "findif",
> > > or in its invocation?
> >
> > The original purpose of findif was to locate an interface. I'm pretty
> > sure that the :number part is incorrect in its invocation - since that
> > implies that you already have a specific interface in mind.
>
> Thanks. I suspected that was the case.
>
> I have just applied a CVS patch to detect this within heartbeat/findif.c
> and to issue a warning (but continue). Feel free to upgrade that to a
> hard error (and fail).
>
> Now we need to investigate why the ":number" is included in the invocation
> in the first place (at least on the Solaris instances I've looked at; does
> it also happen in Linux?).
Got it, I think. In "resources/OCF/IPaddr.in" both the "base" interface
(e.g. "le0") and the new unique interface (e.g. "le0:1") are determined,
but only the new item is passed (internally) into the "add_interface()"
shell function, which really needs both to be available.
I propose applying the attached patch (which passes both interfaces into
"add_interface()") in the next day or so. Could you experts check it
over, please?
I also see an "IPaddr2" script alongside "IPaddr". Might this need
similar attention? (For "IPaddr2", I am unable easily to do run-time
tests at present.)
--
: David Lee I.T. Service :
: Senior Systems Programmer Computer Centre :
: Durham University :
: http://www.dur.ac.uk/t.d.lee/ South Road :
: Durham DH1 3LE :
: Phone: +44 191 334 2752 U.K. :
--- resources/OCF/IPaddr.in.orig Fri Mar 10 17:35:57 2006
+++ resources/OCF/IPaddr.in Thu Apr 20 11:31:22 2006
@@ -496,12 +496,13 @@
add_interface () {
ipaddr="$1"
- iface="$2"
- netmask_bits="$3"
+ iface_base="$2"
+ iface="$3"
+ netmask_bits="$4"
netmask_text=""
- broadcast="$4"
+ broadcast="$5"
- IFCMD="$FINDIF $ipaddr/$netmask_bits/$iface/$broadcast"
+ IFCMD="$FINDIF $ipaddr/$netmask_bits/$iface_base/$broadcast"
NICINFO=`$IFCMD`
rc=$?
@@ -579,7 +580,7 @@
ifname=`cat "$VLDIR/$ipaddr"`
ocf_log info "Restoring loopback IP Address " \
"$ipaddr on $ifname."
- add_interface "$ipaddr" "$ifname" "32"
+ add_interface "$ipaddr" "$ifname" "$ifname" "32"
rm -f "$VLDIR/$ipaddr"
fi
}
@@ -705,7 +706,7 @@
fi
fi
- add_interface "$OCF_RESKEY_ip" "$NIC_unique" "$OCF_RESKEY_netmask"
"$OCF_RESKEY_broadcast"
+ add_interface "$OCF_RESKEY_ip" "$OCF_RESKEY_nic" "$NIC_unique"
"$OCF_RESKEY_netmask" "$OCF_RESKEY_broadcast"
rc=$?
if [ $rc != 0 ]; then
return $rc
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/