diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2022-02-07 06:56:10 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2022-02-07 06:56:10 +0100 |
commit | 43f33c72804e63306580755049c09d5a81ad83e3 (patch) | |
tree | 805caeb00a832ed96a331907987d4e6a2056a391 /backend/escl/escl_devices.c | |
parent | 0f86c5490ea7c2218a4394bf4c21bf3f9267a47c (diff) | |
parent | 6427d36e269d8c14e6bc55373102a4ebc971ca38 (diff) |
Merge branch 'release/debian/1.1.1-1'debian/1.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); } } } |