|
@@ -1002,7 +1002,7 @@ static void passive_monitor (
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
/*
|
|
|
- * Max is larger then threshold -> start adjusting process
|
|
|
|
|
|
|
+ * Max is larger than threshold -> start adjusting process
|
|
|
*/
|
|
*/
|
|
|
if (max > PASSIVE_RECV_COUNT_THRESHOLD) {
|
|
if (max > PASSIVE_RECV_COUNT_THRESHOLD) {
|
|
|
min_all = min_active = recv_count[iface_no];
|
|
min_all = min_active = recv_count[iface_no];
|
|
@@ -1117,9 +1117,15 @@ static void passive_mcast_flush_send (
|
|
|
i++;
|
|
i++;
|
|
|
} while ((i <= instance->interface_count) && (passive_instance->faulty[passive_instance->msg_xmit_iface] == 1));
|
|
} while ((i <= instance->interface_count) && (passive_instance->faulty[passive_instance->msg_xmit_iface] == 1));
|
|
|
|
|
|
|
|
- if (i <= instance->interface_count) {
|
|
|
|
|
- totemnet_mcast_flush_send (instance->net_handles[passive_instance->msg_xmit_iface], msg, msg_len);
|
|
|
|
|
|
|
+ if (i > instance->interface_count) {
|
|
|
|
|
+ /*
|
|
|
|
|
+ * All interfaces are faulty. It's still needed to send mcast
|
|
|
|
|
+ * message to local host so use first interface.
|
|
|
|
|
+ */
|
|
|
|
|
+ passive_instance->msg_xmit_iface = 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ totemnet_mcast_flush_send (instance->net_handles[passive_instance->msg_xmit_iface], msg, msg_len);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void passive_mcast_noflush_send (
|
|
static void passive_mcast_noflush_send (
|
|
@@ -1135,9 +1141,16 @@ static void passive_mcast_noflush_send (
|
|
|
i++;
|
|
i++;
|
|
|
} while ((i <= instance->interface_count) && (passive_instance->faulty[passive_instance->msg_xmit_iface] == 1));
|
|
} while ((i <= instance->interface_count) && (passive_instance->faulty[passive_instance->msg_xmit_iface] == 1));
|
|
|
|
|
|
|
|
- if (i <= instance->interface_count) {
|
|
|
|
|
- totemnet_mcast_noflush_send (instance->net_handles[passive_instance->msg_xmit_iface], msg, msg_len);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (i > instance->interface_count) {
|
|
|
|
|
+ /*
|
|
|
|
|
+ * All interfaces are faulty. It's still needed to send mcast
|
|
|
|
|
+ * message to local host so use first interface.
|
|
|
|
|
+ */
|
|
|
|
|
+ passive_instance->msg_xmit_iface = 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ totemnet_mcast_noflush_send (instance->net_handles[passive_instance->msg_xmit_iface], msg, msg_len);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void passive_token_recv (
|
|
static void passive_token_recv (
|
|
@@ -1179,12 +1192,17 @@ static void passive_token_send (
|
|
|
i++;
|
|
i++;
|
|
|
} while ((i <= instance->interface_count) && (passive_instance->faulty[passive_instance->token_xmit_iface] == 1));
|
|
} while ((i <= instance->interface_count) && (passive_instance->faulty[passive_instance->token_xmit_iface] == 1));
|
|
|
|
|
|
|
|
- if (i <= instance->interface_count) {
|
|
|
|
|
- totemnet_token_send (
|
|
|
|
|
- instance->net_handles[passive_instance->token_xmit_iface],
|
|
|
|
|
- msg, msg_len);
|
|
|
|
|
|
|
+ if (i > instance->interface_count) {
|
|
|
|
|
+ /*
|
|
|
|
|
+ * All interfaces are faulty. It's still needed to send token
|
|
|
|
|
+ * message to (potentionally) local host so use first interface.
|
|
|
|
|
+ */
|
|
|
|
|
+ passive_instance->msg_xmit_iface = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ totemnet_token_send (
|
|
|
|
|
+ instance->net_handles[passive_instance->token_xmit_iface],
|
|
|
|
|
+ msg, msg_len);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void passive_recv_flush (struct totemrrp_instance *instance)
|
|
static void passive_recv_flush (struct totemrrp_instance *instance)
|
|
@@ -1568,13 +1586,25 @@ static void active_mcast_flush_send (
|
|
|
unsigned int msg_len)
|
|
unsigned int msg_len)
|
|
|
{
|
|
{
|
|
|
int i;
|
|
int i;
|
|
|
|
|
+ int msg_sent;
|
|
|
struct active_instance *rrp_algo_instance = (struct active_instance *)instance->rrp_algo_instance;
|
|
struct active_instance *rrp_algo_instance = (struct active_instance *)instance->rrp_algo_instance;
|
|
|
|
|
|
|
|
|
|
+ msg_sent = 0;
|
|
|
|
|
+
|
|
|
for (i = 0; i < instance->interface_count; i++) {
|
|
for (i = 0; i < instance->interface_count; i++) {
|
|
|
if (rrp_algo_instance->faulty[i] == 0) {
|
|
if (rrp_algo_instance->faulty[i] == 0) {
|
|
|
|
|
+ msg_sent = 1;
|
|
|
totemnet_mcast_flush_send (instance->net_handles[i], msg, msg_len);
|
|
totemnet_mcast_flush_send (instance->net_handles[i], msg, msg_len);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (!msg_sent) {
|
|
|
|
|
+ /*
|
|
|
|
|
+ * All interfaces are faulty. It's still needed to send mcast
|
|
|
|
|
+ * message to local host so use first interface.
|
|
|
|
|
+ */
|
|
|
|
|
+ totemnet_mcast_flush_send (instance->net_handles[0], msg, msg_len);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void active_mcast_noflush_send (
|
|
static void active_mcast_noflush_send (
|
|
@@ -1583,13 +1613,25 @@ static void active_mcast_noflush_send (
|
|
|
unsigned int msg_len)
|
|
unsigned int msg_len)
|
|
|
{
|
|
{
|
|
|
int i;
|
|
int i;
|
|
|
|
|
+ int msg_sent;
|
|
|
struct active_instance *rrp_algo_instance = (struct active_instance *)instance->rrp_algo_instance;
|
|
struct active_instance *rrp_algo_instance = (struct active_instance *)instance->rrp_algo_instance;
|
|
|
|
|
|
|
|
|
|
+ msg_sent = 0;
|
|
|
|
|
+
|
|
|
for (i = 0; i < instance->interface_count; i++) {
|
|
for (i = 0; i < instance->interface_count; i++) {
|
|
|
if (rrp_algo_instance->faulty[i] == 0) {
|
|
if (rrp_algo_instance->faulty[i] == 0) {
|
|
|
|
|
+ msg_sent = 1;
|
|
|
totemnet_mcast_noflush_send (instance->net_handles[i], msg, msg_len);
|
|
totemnet_mcast_noflush_send (instance->net_handles[i], msg, msg_len);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (!msg_sent) {
|
|
|
|
|
+ /*
|
|
|
|
|
+ * All interfaces are faulty. It's still needed to send mcast
|
|
|
|
|
+ * message to local host so use first interface.
|
|
|
|
|
+ */
|
|
|
|
|
+ totemnet_mcast_noflush_send (instance->net_handles[0], msg, msg_len);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void active_token_recv (
|
|
static void active_token_recv (
|
|
@@ -1645,15 +1687,30 @@ static void active_token_send (
|
|
|
{
|
|
{
|
|
|
struct active_instance *rrp_algo_instance = (struct active_instance *)instance->rrp_algo_instance;
|
|
struct active_instance *rrp_algo_instance = (struct active_instance *)instance->rrp_algo_instance;
|
|
|
int i;
|
|
int i;
|
|
|
|
|
+ int msg_sent;
|
|
|
|
|
+
|
|
|
|
|
+ msg_sent = 0;
|
|
|
|
|
|
|
|
for (i = 0; i < instance->interface_count; i++) {
|
|
for (i = 0; i < instance->interface_count; i++) {
|
|
|
if (rrp_algo_instance->faulty[i] == 0) {
|
|
if (rrp_algo_instance->faulty[i] == 0) {
|
|
|
|
|
+ msg_sent = 1;
|
|
|
totemnet_token_send (
|
|
totemnet_token_send (
|
|
|
instance->net_handles[i],
|
|
instance->net_handles[i],
|
|
|
msg, msg_len);
|
|
msg, msg_len);
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ if (!msg_sent) {
|
|
|
|
|
+ /*
|
|
|
|
|
+ * All interfaces are faulty. It's still needed to send token
|
|
|
|
|
+ * message to (potentionally) local host so use first interface.
|
|
|
|
|
+ */
|
|
|
|
|
+ totemnet_token_send (
|
|
|
|
|
+ instance->net_handles[0],
|
|
|
|
|
+ msg, msg_len);
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
static void active_recv_flush (struct totemrrp_instance *instance)
|
|
static void active_recv_flush (struct totemrrp_instance *instance)
|