]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
cups-browsed: Do not try to resolve interface name on Avahi messages which are not... 128/head
authorTill Kamppeter <till.kamppeter@gmail.com>
Fri, 4 Oct 2019 08:47:13 +0000 (10:47 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Fri, 4 Oct 2019 08:47:13 +0000 (10:47 +0200)
NEWS
utils/cups-browsed.c

diff --git a/NEWS b/NEWS
index a8a8f392783b8f4ad416c77e8e315c4fb96f33f5..090d9e9098a96b0c09a3538604c8b925645cb36e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,9 @@ NEWS - OpenPrinting CUPS Filters v1.25.6 - 2019-09-23
 
 CHANGES IN V1.25.7
 
+       - cups-browsed: Do not try to resolve the network interface
+         name on Avahi messages which are not interface-related (like
+         "All for now"or "Cache exhausted", Issue #163).
        - Build system: The helper script ln-srf to build on systems
          with old ln was not included in the release tarballs (Issue
          #161).
index 2f67d0c4d229f0066986c908d3c1a9ec4dae9333..1a2772116394305dee90c40db37e4a8bdcf2311a 100644 (file)
@@ -9703,13 +9703,6 @@ static void browse_callback(AvahiServiceBrowser *b,
   if (b == NULL)
     return;
 
-  /* Get the interface name */
-  if (!if_indextoname(interface, ifname)) {
-    debug_printf("Unable to find interface name for interface %d: %s\n",
-                interface, strerror(errno));
-    strncpy(ifname, "Unknown", sizeof(ifname));
-  }
-
   /* Called whenever a new services becomes available on the LAN or
      is removed from the LAN */
 
@@ -9730,6 +9723,13 @@ static void browse_callback(AvahiServiceBrowser *b,
     if (c == NULL || name == NULL || type == NULL || domain == NULL)
       return;
 
+    /* Get the interface name */
+    if (!if_indextoname(interface, ifname)) {
+      debug_printf("Unable to find interface name for interface %d: %s\n",
+                  interface, strerror(errno));
+      strncpy(ifname, "Unknown", sizeof(ifname));
+    }
+
     debug_printf("Avahi Browser: NEW: service '%s' of type '%s' in domain '%s' on interface '%s' (%s)\n",
                 name, type, domain, ifname,
                 protocol != AVAHI_PROTO_UNSPEC ?
@@ -9758,6 +9758,13 @@ static void browse_callback(AvahiServiceBrowser *b,
     if (name == NULL || type == NULL || domain == NULL)
       return;
 
+    /* Get the interface name */
+    if (!if_indextoname(interface, ifname)) {
+      debug_printf("Unable to find interface name for interface %d: %s\n",
+                  interface, strerror(errno));
+      strncpy(ifname, "Unknown", sizeof(ifname));
+    }
+
     debug_printf("Avahi Browser: REMOVE: service '%s' of type '%s' in domain '%s' on interface '%s' (%s)\n",
                 name, type, domain, ifname,
                 protocol != AVAHI_PROTO_UNSPEC ?