| 650 | } |
| 651 | |
| 652 | gboolean |
| 653 | node_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 | } |
no outgoing calls
no test coverage detected