diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2022-02-01 15:24:35 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2022-02-01 15:24:35 +0100 |
commit | 302276dc1b90cfc972fb726ca94a23b18f4b0088 (patch) | |
tree | 33d99da40fb5fa097fdab5584d7ed550d25a33bb /backend/escl/escl_devices.c | |
parent | 351b7328520c16730ceb46e5acae16038c42185e (diff) |
New upstream version 1.1.1upstream/1.1.1
Diffstat (limited to 'backend/escl/escl_devices.c')
-rw-r--r-- | backend/escl/escl_devices.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/backend/escl/escl_devices.c b/backend/escl/escl_devices.c index 3ca28de..92e064b 100644 --- a/backend/escl/escl_devices.c +++ b/backend/escl/escl_devices.c @@ -74,6 +74,7 @@ resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interfac avahi_address_snprint(a, sizeof(a), address); t = avahi_string_list_to_string(txt); if (strstr(t, "\"rs=eSCL\"") || strstr(t, "\"rs=/eSCL\"")) { + char ip_add[PATH_MAX] = {0}; s = avahi_string_list_find(txt, "is"); if (s && s->size > 3) is = (const char*)s->text + 3; @@ -84,7 +85,14 @@ resolve_callback(AvahiServiceResolver *r, AVAHI_GCC_UNUSED AvahiIfIndex interfac uuid = (const char*)s->text + 5; else uuid = (const char*)NULL; - escl_device_add(port, name, a, is, uuid, (char*)type); + DBG (10, "resolve_callback [%s]\n", a); + if (strstr(a, "127.0.0.1") != NULL) { + snprintf(ip_add, sizeof(ip_add), "%s", "localhost"); + DBG (10,"resolve_callback fix redirect [localhost]\n"); + } + else + snprintf(ip_add, sizeof(ip_add), "%s", a); + escl_device_add(port, name, ip_add, is, uuid, (char*)type); } } } |