]> git.meshlink.io Git - catta/blobdiff - avahi-core/server.c
* Some minor cleanups in netlink code
[catta] / avahi-core / server.c
index 77646359b198af8bd36ce4a851a235de72d1fc49..f23ef392e637b0fb602f115c484d52d157e4cd81 100644 (file)
@@ -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;