X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=avahi-core%2Fserver.c;h=f23ef392e637b0fb602f115c484d52d157e4cd81;hb=d322a943be5387a539f8f3ea3a19a7e2ed5a55a2;hp=77646359b198af8bd36ce4a851a235de72d1fc49;hpb=a3f8ceb929420a0be2b2c8341382fdfe0a50b859;p=catta diff --git a/avahi-core/server.c b/avahi-core/server.c index 7764635..f23ef39 100644 --- a/avahi-core/server.c +++ b/avahi-core/server.c @@ -881,7 +881,7 @@ static int originates_from_local_legacy_unicast_socket(AvahiServer *s, const str struct sockaddr_in lsa; socklen_t l = sizeof(lsa); - if (getsockname(s->fd_legacy_unicast_ipv4, &lsa, &l) != 0) + if (getsockname(s->fd_legacy_unicast_ipv4, (struct sockaddr*) &lsa, &l) != 0) avahi_log_warn("getsockname(): %s", strerror(errno)); else return lsa.sin_port == ((const struct sockaddr_in*) sa)->sin_port; @@ -892,7 +892,7 @@ static int originates_from_local_legacy_unicast_socket(AvahiServer *s, const str struct sockaddr_in6 lsa; socklen_t l = sizeof(lsa); - if (getsockname(s->fd_legacy_unicast_ipv6, &lsa, &l) != 0) + if (getsockname(s->fd_legacy_unicast_ipv6, (struct sockaddr*) &lsa, &l) != 0) avahi_log_warn("getsockname(): %s", strerror(errno)); else return lsa.sin6_port == ((const struct sockaddr_in6*) sa)->sin6_port; @@ -1360,7 +1360,7 @@ AvahiServer *avahi_server_new(const AvahiPoll *poll_api, const AvahiServerConfig AvahiServer *s; int e; - if ((e = valid_server_config(sc)) < 0) { + if (sc && (e = valid_server_config(sc)) < 0) { if (error) *error = e; return NULL;