From 84c10a86f0cd2178993598d31a6042e074f0b559 Mon Sep 17 00:00:00 2001 From: bstepankova Date: Tue, 20 Feb 2018 09:17:38 +0100 Subject: [PATCH] Problem: index has to be counted for any device not just for daisychain Solution: counted for both Signed-off-by: Barbora Stepankova --- drivers/snmp-ups.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/snmp-ups.c b/drivers/snmp-ups.c index 13363f6945..48f05aea60 100644 --- a/drivers/snmp-ups.c +++ b/drivers/snmp-ups.c @@ -2225,21 +2225,23 @@ bool_t daisychain_init() } } - /* Finally, compute and store the base OID index and NUT offset */ - su_info_p = su_find_info("device.model"); - if (su_info_p != NULL) - { - device_template_index_base = base_snmp_template_index(su_info_p); - upsdebugx(1, "%s: device_template_index_base = %i", __func__, device_template_index_base); - device_template_offset = device_template_index_base - 1; - upsdebugx(1, "%s: device_template_offset = %i", __func__, device_template_offset); - } } else { daisychain_enabled = FALSE; upsdebugx(1, "No device.count entry found, daisychain support not needed"); } + /* Finally, compute and store the base OID index and NUT offset */ + su_info_p = su_find_info("device.model"); + if (su_info_p != NULL) { + device_template_index_base = base_snmp_template_index(su_info_p); + upsdebugx(1, "%s: device_template_index_base = %i", __func__, device_template_index_base); + device_template_offset = device_template_index_base - 1; + upsdebugx(1, "%s: device_template_offset = %i", __func__, device_template_offset); + } + + + return daisychain_enabled; }