Use AF_UNSPEC instead of -1 as error code for family

This commit is contained in:
Julien BLACHE 2010-09-26 14:52:41 +02:00
parent a3d549bd37
commit a4c74c2063

View File

@ -395,7 +395,7 @@ browse_resolve_callback(AvahiServiceResolver *r, AvahiIfIndex intf, AvahiProtoco
case AVAHI_PROTO_INET: case AVAHI_PROTO_INET:
if (ll) if (ll)
{ {
family = -1; family = AF_UNSPEC;
DPRINTF(E_DBG, L_MDNS, "Discarding IPv4 LL address\n"); DPRINTF(E_DBG, L_MDNS, "Discarding IPv4 LL address\n");
break; break;
@ -416,7 +416,7 @@ browse_resolve_callback(AvahiServiceResolver *r, AvahiIfIndex intf, AvahiProtoco
{ {
DPRINTF(E_LOG, L_MDNS, "Could not map interface index %d to a name\n", intf); DPRINTF(E_LOG, L_MDNS, "Could not map interface index %d to a name\n", intf);
family = -1; family = AF_UNSPEC;
break; break;
} }
@ -426,7 +426,7 @@ browse_resolve_callback(AvahiServiceResolver *r, AvahiIfIndex intf, AvahiProtoco
{ {
DPRINTF(E_LOG, L_MDNS, "Buffer too short for scoped IPv6 LL\n"); DPRINTF(E_LOG, L_MDNS, "Buffer too short for scoped IPv6 LL\n");
family = -1; family = AF_UNSPEC;
break; break;
} }
@ -439,11 +439,11 @@ browse_resolve_callback(AvahiServiceResolver *r, AvahiIfIndex intf, AvahiProtoco
default: default:
DPRINTF(E_INFO, L_MDNS, "Avahi Resolver: unknown protocol %d\n", proto); DPRINTF(E_INFO, L_MDNS, "Avahi Resolver: unknown protocol %d\n", proto);
family = -1; family = AF_UNSPEC;
break; break;
} }
if (family == -1) if (family == AF_UNSPEC)
break; break;
memset(&txt_kv, 0, sizeof(struct keyval)); memset(&txt_kv, 0, sizeof(struct keyval));
@ -542,11 +542,11 @@ browse_callback(AvahiServiceBrowser *b, AvahiIfIndex intf, AvahiProtocol proto,
default: default:
DPRINTF(E_INFO, L_MDNS, "Avahi Browser: unknown protocol %d\n", proto); DPRINTF(E_INFO, L_MDNS, "Avahi Browser: unknown protocol %d\n", proto);
family = -1; family = AF_UNSPEC;
break; break;
} }
if (family != -1) if (family != AF_UNSPEC)
mb->cb(name, type, domain, NULL, family, NULL, -1, NULL); mb->cb(name, type, domain, NULL, family, NULL, -1, NULL);
break; break;