]> git.meshlink.io Git - catta/blobdiff - avahi-core/iface-pfroute.c
update TODO, only 3 items on the TODO left
[catta] / avahi-core / iface-pfroute.c
index a7ecdc95c57e010f12c7640a4153176b92724aa5..6d7de60c9869785d86b256c38af798d6bc2bd5e2 100644 (file)
@@ -119,7 +119,7 @@ static void rtm_addr(struct rt_msghdr *rtm, AvahiInterfaceMonitor *m)
   int prefixlen = 0;
   struct sockaddr *sa  =NULL;
 
-#ifdef __NetBSD__  
+#if defined(__NetBSD__) || defined(__OpenBSD__)
   if(((struct sockaddr *)cp)->sa_family == AF_UNSPEC)
     ((struct sockaddr *)cp)->sa_family = AF_INET;
 #endif
@@ -321,11 +321,20 @@ void avahi_interface_monitor_sync(AvahiInterfaceMonitor *m) {
   mib[4] = NET_RT_IFLIST;
   mib[5] = 0;             /* no flags */
   if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0)
-    return;
+    {
+      avahi_log_error("sysctl failed: %s", strerror(errno));
+      avahi_log_error("route-sysctl-estimate");
+      return;
+    }
   if ((buf = avahi_malloc(needed)) == NULL)
-    return;
+    {
+      avahi_log_error("malloc failed in avahi_interface_monitor_sync");
+      return;
+    }
   if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) {
+    avahi_log_warn("sysctl failed: %s", strerror(errno));
     if (errno == ENOMEM && count++ < 10) {
+      avahi_log_warn("Routing table grew, retrying");
       sleep(1);
       avahi_free(buf);
       goto retry2;