BasicSanityCheck has never worked under Solaris: the sum of several issues
each of which needs tackling one by one. I've done a few of those in
recent weeks. But yet others remain.
My next target is "findif". This works OK(-ish) in typical production
mode, for which the address is typically on the local networks(s). But
BSC's particular use of it is with a _remote_ address (10.253.252.251)
which typically would be over a "default" route.
For remote/default addresses the command "route -n get 10.253.252.251"
on Solaris returns:
destination: default
mask: default
(i.e. value is literally the string "default").
I propose the attached patch which, on seeing a mask "default", assumes
"0.0.0.0" and takes it from there. (See comment in patch.)
(Oh! If only there were a decent API to read the routing table...)
Any comments, anyone? (I'm not entirely happy with the patch. But given
that this whole area is in practice sub-ideal anyway, is it at least "good
enough"?)
--
: 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. :--- heartbeat/findif.c.orig Wed Nov 9 16:03:22 2005
+++ heartbeat/findif.c Wed Jan 25 13:16:19 2006
@@ -367,6 +367,24 @@
if (strnlen(mask, sizeof(mask)) == 0) {
strncpy (mask, "255.255.255.255", sizeof(mask));
}
+
+ /*
+ * Solaris (at least) can return the word "default" for mask and dest.
+ * For the moment, let's interpret this pair as:
+ * mask: 0.0.0.0
+ * destination: <original IP>
+ * (Does "dest" ever get used?)
+ * This was manifesting itself under "BasicSanityCheck", which tries
+ * to use a remote IP number; these typically use the "default" route.
+ * Better schemes are warmly invited...
+ */
+ if (strncmp(mask, "default", sizeof("default")) == 0) {
+ strncpy (mask, "0.0.0.0", sizeof(mask));
+ }
+ if (strncmp(dest, "default", sizeof("default")) == 0) {
+ strncpy (dest, address, sizeof(dest));
+ }
+
ConvertQuadToInt (dest, sizeof(dest));
ConvertBitsToMask (mask, sizeof(mask));
/*
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/