Blob Blame History Raw
--- cups-1.6.3.rsac.old/backend/snmp-supplies.c	2013-06-06 18:12:52.000000000 -0700
+++ cups-1.6.3.rsac.new/backend/snmp-supplies.c	2017-02-20 15:57:28.420977310 -0800
@@ -90,6 +90,8 @@ static backend_supplies_t supplies[CUPS_
 					/* Supply information */
 static int		supply_state = -1;
 					/* Supply state info */
+static int              use_snmp_pages = 1;
+                                        /* Report pages used or not */
 
 static const int	hrDeviceDescr[] =
 			{ CUPS_OID_hrDeviceDescr, 1, -1 };
@@ -410,16 +412,21 @@ backendSNMPSupplies(
 
     if (page_count)
     {
-      if (!_cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1,
-			 _cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
-			 prtMarkerLifeCount))
-	return (-1);
-
-      if (!_cupsSNMPRead(snmp_fd, &packet, CUPS_SUPPLY_TIMEOUT) ||
-	  packet.object_type != CUPS_ASN1_COUNTER)
-	return (-1);
-
-      *page_count = packet.object_value.counter;
+      if (use_snmp_pages)
+      {
+        if (!_cupsSNMPWrite(snmp_fd, addr, CUPS_SNMP_VERSION_1,
+                            _cupsSNMPDefaultCommunity(), CUPS_ASN1_GET_REQUEST, 1,
+                            prtMarkerLifeCount))
+          return (-1);
+
+        if (!_cupsSNMPRead(snmp_fd, &packet, CUPS_SUPPLY_TIMEOUT) ||
+            packet.object_type != CUPS_ASN1_COUNTER)
+          return (-1);
+        
+        *page_count = packet.object_value.counter;
+      }
+      else
+        *page_count = 0;
     }
 
     return (0);
@@ -521,6 +528,12 @@ backend_init_supplies(
       quirks |= CUPS_SNMP_CAPACITY;
   }
 
+  if ((ppdattr = ppdFindAttr(ppd, "cupsSNMPPages", NULL)) != NULL )
+  {
+    if (_cups_strcasecmp(ppdattr->value, "true"))
+      use_snmp_pages = 0;
+  }
+
   ppdClose(ppd);
 
  /*