summaryrefslogtreecommitdiff
path: root/main/utils.c
diff options
context:
space:
mode:
authorAlexei Gradinari <alex2grad@gmail.com>2016-08-10 15:41:38 -0400
committerAlexei Gradinari <alex2grad@gmail.com>2016-08-15 13:35:59 -0500
commite85adbd947fac6b5385f1b74eba506e53c78f483 (patch)
treece70611a949789c74be8f1ebfb9c8ae1870fb3d6 /main/utils.c
parent8b1e919ae46bdab02010a9d25c1c27670b03e87f (diff)
core: Entity ID is not set or invalid
The Exchanging Device and Mailbox States could not working if the Entity ID (EID) is not set manually and can't be obtained from ethernet interface. This patch replaces debug message to warning and addes missing description about option 'entityid' to asterisk.conf.sample. With this patch the asterisk also: (1) decline loading the modules which won't work without EID: res_corosync and res_pjsip_publish_asterisk. (2) warn if EID is empty on loading next modules: pbx_dundi, res_xmpp Starting with v197 systemd/udev will automatically assign "predictable" names for all local Ethernet interfaces. This patch also addes some new ethernet prefixes "eno" and "ens". ASTERISK-26164 #close Change-Id: I72d712f1ad5b6f64571bb179c5cb12461e7c58c6
Diffstat (limited to 'main/utils.c')
-rw-r--r--main/utils.c12
1 files changed, 10 insertions, 2 deletions
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)