Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 1 | From e47c60dc7f649959f63e56bc62355de4bdfd73f4 Mon Sep 17 00:00:00 2001 |
| 2 | From: Marian Florea <marian.florea@windriver.com> |
| 3 | Date: Thu, 20 Jul 2017 16:55:24 +0800 |
| 4 | Subject: [PATCH] net snmp: fix engineBoots value on SIGHUP |
| 5 | |
| 6 | Upstream-Status: Pending |
| 7 | |
| 8 | Signed-off-by: Marian Florea <marian.florea@windriver.com> |
| 9 | Signed-off-by: Li Zhou <li.zhou@windriver.com> |
| 10 | --- |
| 11 | agent/snmpd.c | 1 + |
| 12 | snmplib/snmpv3.c | 4 ++-- |
| 13 | 2 files changed, 3 insertions(+), 2 deletions(-) |
| 14 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 15 | Index: net-snmp-5.7.3/agent/snmpd.c |
| 16 | =================================================================== |
| 17 | --- net-snmp-5.7.3.orig/agent/snmpd.c |
| 18 | +++ net-snmp-5.7.3/agent/snmpd.c |
| 19 | @@ -1253,6 +1253,7 @@ receive(void) |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 20 | snmp_log(LOG_INFO, "NET-SNMP version %s restarted\n", |
| 21 | netsnmp_get_version()); |
| 22 | update_config(); |
| 23 | + snmp_store(app_name); |
| 24 | send_easy_trap(SNMP_TRAP_ENTERPRISESPECIFIC, 3); |
| 25 | #if HAVE_SIGHOLD |
| 26 | sigrelse(SIGHUP); |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 27 | Index: net-snmp-5.7.3/snmplib/snmpv3.c |
| 28 | =================================================================== |
| 29 | --- net-snmp-5.7.3.orig/snmplib/snmpv3.c |
| 30 | +++ net-snmp-5.7.3/snmplib/snmpv3.c |
| 31 | @@ -984,9 +984,9 @@ init_snmpv3_post_config(int majorid, int |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 32 | /* |
| 33 | * if our engineID has changed at all, the boots record must be set to 1 |
| 34 | */ |
| 35 | - if (engineIDLen != oldEngineIDLength || |
| 36 | + if (oldEngineIDLength != (size_t)0 && (engineIDLen != oldEngineIDLength || |
| 37 | oldEngineID == NULL || c_engineID == NULL || |
| 38 | - memcmp(oldEngineID, c_engineID, engineIDLen) != 0) { |
| 39 | + memcmp(oldEngineID, c_engineID, engineIDLen) != 0)) { |
| 40 | engineBoots = 1; |
| 41 | } |
| 42 | |