diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2022-02-01 15:25:04 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2022-02-01 15:25:04 +0100 |
commit | 8e5d399808d2270ae9d56c96560a021e594d18a4 (patch) | |
tree | cb83e4c8216cf0e8bcaa17a6f2cb64cf4d7f469a /backend/escl/escl_devices.c | |
parent | 97e55bdc5cdf59304af739e65f416320bcbcf599 (diff) | |
parent | 302276dc1b90cfc972fb726ca94a23b18f4b0088 (diff) |
Update upstream source from tag 'upstream/1.1.1'
Update to upstream version '1.1.1'
with Debian dir 4cb81ae9eaa2503b9c320ac1e8125f9df6e7f7b3
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); } } } |