Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-23621

zbx_snmp_walk loops forever when receiving empty snmp replies.

XMLWordPrintable

    • Sprint 106 (Nov 2023)
    • 1

      Steps to reproduce:

      Our Cisco UCS manager sometimes generates empty replies to GetBulk requests. (error=0, index=0, varbind length=0). The poller reacts to this by sending the same request again. Resulting in a storm of requests&empty replies.

      Result:

      IP (tos 0x0, ttl 64, id 57012, offset 0, flags [none], proto UDP (17), length 80)
          10.255.0.134.21437 > 10.14.90.105.161:  { SNMPv2c C="xxxxx" { GetBulk(38) R=807747303  N=0 M=0 .1.3.6.1.4.1.9.9.719.1.1.1.1.20.8611890 } } 
              0x0000:  4500 0050 deb4 0000 4011 xxxx 0aff 0086  E..P....xxxx....
              0x0010:  0a0e 5a69 53bd 00a1 003c xxxx 3032 0201  ..ZiS...xxxx02..
              0x0020:  0104 05xx xxxx xxxx a526 0204 3025 3ee7  ...xxxxx.&..0%>.
              0x0030:  0201 0002 0100 3018 3016 0612 2b06 0104  ......0.0...+...
              0x0040:  0109 0985 4f01 0101 0114 848d d032 0500  ....O........2..
      IP (tos 0x0, ttl 63, id 52275, offset 0, flags [none], proto UDP (17), length 56)
          10.14.90.105.161 > 10.255.0.134.21437:  { SNMPv2c C="xxxxx" { GetResponse(14) R=807747303  } } 
              0x0000:  4500 0038 cc33 0000 3f11 xxxx 0a0e 5a69  E..8.3..xxxx..Zi
              0x0010:  0aff 0086 00a1 53bd 0024 xxxx 301a 0201  ......S.xxxx0...
              0x0020:  0104 05xx xxxx xxxx a20e 0204 3025 3ee7  ...xxxxx....0%>.
              0x0030:  0201 0002 0100 3000                      ......0.
              
      0x0028: a2 0e            SNMP response, len=14
      0x002a: 02 04 30253ee7   request id (int, len=4, 0x30253ee7)
      0x0030: 02 01 00         error status (int, len=1, 0)
      0x0033: 02 01 00         snmpIndex (int, len=1, 0)
      0x0036: 30 00            varbindlist len=0
      

      The above packets repeat several hundred times per second.

      Expected:
      I'm currently testing this patch:

      --- checks_snmp.c.dist  2023-10-30 12:32:27.650772000 +0100
      +++ checks_snmp.c       2023-10-30 12:34:11.120649000 +0100
      @@ -1304,6 +1304,13 @@
                              goto next;
                      }
       
      +                if (NULL == response->variables) {
      +                        zbx_strlcpy(error, "received empty reply.", max_error_len);
      +                        ret = NOTSUPPORTED;
      +                        running = 0;
      +                        break;
      +                }
      +
                      /* process response */
                      for (num_vars = 0, var = response->variables; NULL != var; num_vars++, var = var->next_variable)
                      { 

      (patch is against master)

            wiper Andris Zeila
            jodocus Joost Bekkers
            Team A
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: