diff options
author | zuul <zuul@gerrit.asterisk.org> | 2016-08-16 10:03:18 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-08-16 10:03:18 -0500 |
commit | 72b102bab8570ff4d655fd13046f447807e9cbf7 (patch) | |
tree | 5cca062faa94c46b4944fa05a15a22066d0e63b3 /main | |
parent | 1ae4b3c289e1cebaf94ed3b3979269c4a540d751 (diff) | |
parent | 811e7d778851a844cc99987b818d14b68825ab8c (diff) |
Merge "core: Entity ID is not set or invalid" into 14
Diffstat (limited to 'main')
-rw-r--r-- | main/asterisk.c | 6 | ||||
-rw-r--r-- | main/utils.c | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index 50d8af24a..3c2ca259e 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -3661,10 +3661,10 @@ static void ast_readconfig(void) } else if (!strcasecmp(v->name, "entityid")) { struct ast_eid tmp_eid; if (!ast_str_to_eid(&tmp_eid, v->value)) { - ast_verbose("Successfully set global EID to '%s'\n", v->value); ast_eid_default = tmp_eid; - } else - ast_verbose("Invalid Entity ID '%s' provided\n", v->value); + } else { + ast_log(LOG_WARNING, "Invalid Entity ID '%s' provided\n", v->value); + } } else if (!strcasecmp(v->name, "lightbackground")) { ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_LIGHT_BACKGROUND); } else if (!strcasecmp(v->name, "forceblackbackground")) { diff --git a/main/utils.c b/main/utils.c index 46edf43ea..1d2aa0b27 100644 --- a/main/utils.c +++ b/main/utils.c @@ -2488,7 +2488,7 @@ void ast_set_default_eid(struct ast_eid *eid) return; } for (x = 0; x < MAXIF; x++) { - static const char *prefixes[] = { "eth", "em" }; + static const char *prefixes[] = { "eth", "em", "eno", "ens" }; unsigned int i; for (i = 0; i < ARRAY_LEN(prefixes); i++) { @@ -2539,7 +2539,7 @@ void ast_set_default_eid(struct ast_eid *eid) } #endif #endif - ast_debug(1, "No ethernet interface found for seeding global EID. You will have to set it manually.\n"); + ast_log(LOG_WARNING, "No ethernet interface found for seeding global EID. You will have to set it manually.\n"); } int ast_str_to_eid(struct ast_eid *eid, const char *s) @@ -2564,6 +2564,14 @@ int ast_eid_cmp(const struct ast_eid *eid1, const struct ast_eid *eid2) return memcmp(eid1, eid2, sizeof(*eid1)); } +int ast_eid_is_empty(const struct ast_eid *eid) +{ + struct ast_eid empty_eid; + + memset(&empty_eid, 0, sizeof(empty_eid)); + return memcmp(eid, &empty_eid, sizeof(empty_eid)) ? 0 : 1; +} + int ast_file_is_readable(const char *filename) { #if defined(HAVE_EACCESS) || defined(HAVE_EUIDACCESS) |