]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - backend/snmp.c
Merge CUPS 1.4svn-r7319.
[thirdparty/cups.git] / backend / snmp.c
index a001ff8642b760aaa763dc886bf60f9fad85c2fc..9b4532948fef7af78bd6b3367c501b5e72cad26b 100644 (file)
@@ -175,9 +175,9 @@ static cups_array_t *Addresses = NULL;
 static cups_array_t    *Communities = NULL;
 static cups_array_t    *Devices = NULL;
 static int             DebugLevel = 0;
-static int             DeviceDescOID[] = { CUPS_OID_hrDeviceDescr, 1, 0 };
+static int             DeviceDescOID[] = { CUPS_OID_hrDeviceDescr, 1, -1 };
 static unsigned                DeviceDescRequest;
-static int             DeviceTypeOID[] = { CUPS_OID_hrDeviceType, 1, 0 };
+static int             DeviceTypeOID[] = { CUPS_OID_hrDeviceType, 1, -1 };
 static unsigned                DeviceTypeRequest;
 static cups_array_t    *DeviceURIs = NULL;
 static int             HostNameLookups = 0;
@@ -236,7 +236,7 @@ main(int  argc,                             /* I - Number of command-line arguments (6 or 7) */
   * Open the SNMP socket...
   */
 
-  if ((fd = cupsSNMPOpen()) < 0)
+  if ((fd = cupsSNMPOpen(AF_INET)) < 0)
     return (1);
 
  /*
@@ -719,7 +719,8 @@ probe_device(snmp_cache_t *device)  /* I - Device */
   for (device_uri = (device_uri_t *)cupsArrayFirst(DeviceURIs);
        device_uri;
        device_uri = (device_uri_t *)cupsArrayNext(DeviceURIs))
-    if (!regexec(&(device_uri->re), device->make_and_model, 0, NULL, 0))
+    if (device->make_and_model &&
+        !regexec(&(device_uri->re), device->make_and_model, 0, NULL, 0))
     {
      /*
       * Found a match, add the URIs...