]> git.meshlink.io Git - catta/blobdiff - avahi-core/iface-pfroute.c
allow adding of generic DNS RRs properly. Patch from Sjoerd Simons again (closes...
[catta] / avahi-core / iface-pfroute.c
index a67b8267a1bf5bcbe957a469a29b3a7ddf537bab..f96bfc2924f827322d1ac090586fc6e4fb441c03 100644 (file)
@@ -262,10 +262,11 @@ static void socket_event(AvahiWatch *w, int fd, AVAHI_GCC_UNUSED AvahiWatchEvent
 
 int avahi_interface_monitor_init_osdep(AvahiInterfaceMonitor *m) {
     int fd = -1;
-    m->osdep.pfroute = NULL;
 
     assert(m);
 
+    m->osdep.pfroute = NULL;
+
     if ((fd = socket(PF_ROUTE, SOCK_RAW, AF_UNSPEC)) < 0) {
         avahi_log_error(__FILE__": socket(PF_ROUTE): %s", strerror(errno));
         goto fail;
@@ -318,7 +319,7 @@ void avahi_interface_monitor_free_osdep(AvahiInterfaceMonitor *m) {
     }
 }
 
-#ifndef HAVE_SYS_SYSCTL_H
+#if defined (SIOCGLIFNUM) && defined(HAVE_STRUCT_LIFCONF) /* Solaris 8 and later; Sol 7? */
 /*
  * I got this function from GNU zsbra
  */
@@ -428,7 +429,7 @@ static void if_add_interface(struct lifreq *lifreq, AvahiInterfaceMonitor *m, in
 #endif
 
 void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
-#ifdef HAVE_SYS_SYSCTL_H
+#ifndef HAVE_STRUCT_LIFCONF
   size_t needed;
   int mib[6];
   char *buf, *lim, *next, count = 0;
@@ -473,7 +474,7 @@ void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
   avahi_interface_monitor_check_relevant(m);
   avahi_interface_monitor_update_rrs(m, 0);
   avahi_log_info("Network interface enumeration completed.");
-#else
+#elif defined (SIOCGLIFNUM) && defined(HAVE_STRUCT_LIFCONF) /* Solaris 8 and later; Sol 7? */
     int sockfd;
     int ret;
     int n;