Knet limits maximum node id to 16-bit type. This was not ensured in
corosync and it was possible to set nodeid to value >= 65536 and
(surprisingly) most of the things were working quite well because of
overflow. corosync-cmapctl -m stats contained knet nodeid in
stats.knet. subtree, so for nodeid 65536 result was:
Can't get value of stats.knet.node0.link0.connected. Error
CS_ERR_NOT_EXIST
Commit implements checking of nodeid and limits it to KNET_MAX_HOST
value when knet is used.
Signed-off-by: Jan Friesse <jfriesse@redhat.com>
Reviewed-by: Christine Caulfield <ccaulfie@redhat.com>
return (-1);
}
+ if (totem_config->transport_number == TOTEM_TRANSPORT_KNET && nodeid >= KNET_MAX_HOST) {
+ sprintf(error_string_response,
+ "Knet requires nodeid to be less than %u "
+ "for address '%s'.", KNET_MAX_HOST, node_addr_str);
+ *error_string = error_string_response;
+
+ return (-1);
+ }
+
member_count = totem_config->interfaces[linknumber].member_count;
res = totemip_parse(&totem_config->interfaces[linknumber].member_list[member_count],
node_addr_str, totem_config->ip_version);