Mercurial > pidgin
comparison libpurple/protocols/bonjour/mdns_avahi.c @ 32372:0734b9c8c345
propagate from branch 'im.pidgin.pidgin.2.x.y' (head bc79b1bf09dcfa1d8edac86a06761fce7416e69c)
to branch 'im.pidgin.pidgin' (head 1f625d66be9b91c38a5398c3a4c302c651a19698)
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Wed, 30 Nov 2011 01:16:33 +0000 |
parents | e895aebcb504 d6cc1ff0d9b7 |
children |
comparison
equal
deleted
inserted
replaced
32368:ca4714f51bb1 | 32372:0734b9c8c345 |
---|---|
177 | 177 |
178 /* Get the ip as a string */ | 178 /* Get the ip as a string */ |
179 ip[0] = '\0'; | 179 ip[0] = '\0'; |
180 avahi_address_snprint(ip, AVAHI_ADDRESS_STR_MAX, a); | 180 avahi_address_snprint(ip, AVAHI_ADDRESS_STR_MAX, a); |
181 | 181 |
182 if (protocol == AVAHI_PROTO_INET6) | |
183 append_iface_if_linklocal(ip, interface); | |
184 | |
182 purple_debug_info("bonjour", "_resolve_callback - name:%s ip:%s prev_ip:%s\n", | 185 purple_debug_info("bonjour", "_resolve_callback - name:%s ip:%s prev_ip:%s\n", |
183 name, ip, rd->ip); | 186 name, ip, rd->ip); |
184 | 187 |
185 if (rd->ip == NULL || strcmp(rd->ip, ip) != 0) { | 188 if (rd->ip == NULL || strcmp(rd->ip, ip) != 0) { |
186 /* We store duplicates in bb->ips, so we always remove the one */ | 189 /* We store duplicates in bb->ips, so we always remove the one */ |
188 bb->ips = g_slist_remove(bb->ips, rd->ip); | 191 bb->ips = g_slist_remove(bb->ips, rd->ip); |
189 g_free((gchar *) rd->ip); | 192 g_free((gchar *) rd->ip); |
190 } | 193 } |
191 /* IPv6 goes at the front of the list and IPv4 at the end so that we "prefer" IPv6, if present */ | 194 /* IPv6 goes at the front of the list and IPv4 at the end so that we "prefer" IPv6, if present */ |
192 if (protocol == AVAHI_PROTO_INET6) { | 195 if (protocol == AVAHI_PROTO_INET6) { |
193 rd->ip = g_strdup_printf("%s%%%d", ip, interface); | 196 rd->ip = g_strdup_printf("%s", ip); |
194 bb->ips = g_slist_prepend(bb->ips, (gchar *) rd->ip); | 197 bb->ips = g_slist_prepend(bb->ips, (gchar *) rd->ip); |
195 } else { | 198 } else { |
196 rd->ip = g_strdup(ip); | 199 rd->ip = g_strdup(ip); |
197 bb->ips = g_slist_append(bb->ips, (gchar *) rd->ip); | 200 bb->ips = g_slist_append(bb->ips, (gchar *) rd->ip); |
198 } | 201 } |