MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / node_name_is_valid

Function node_name_is_valid

lib/cluster/cluster.c:652–671  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652gboolean
653node_name_is_valid(const char *key, const char *name)
654{
655 int octet;
656
657 if(name == NULL) {
658 crm_trace("%s is empty", key);
659 return FALSE;
660
661 } else if(sscanf(name, "%d.%d.%d.%d", &octet, &octet, &octet, &octet) == 4) {
662 crm_trace("%s contains an ipv4 address, ignoring: %s", key, name);
663 return FALSE;
664
665 } else if(strstr(name, ":") != NULL) {
666 crm_trace("%s contains an ipv6 address, ignoring: %s", key, name);
667 return FALSE;
668 }
669 crm_trace("%s is valid", key);
670 return TRUE;
671}

Callers 1

corosync_node_nameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected