blob: fbd274bba497edd5e355019d85e6b15f54e397d4 [file] [log] [blame]
Brad Bishopd7bf8c12018-02-25 22:55:05 -05001From e47c60dc7f649959f63e56bc62355de4bdfd73f4 Mon Sep 17 00:00:00 2001
2From: Marian Florea <marian.florea@windriver.com>
3Date: Thu, 20 Jul 2017 16:55:24 +0800
4Subject: [PATCH] net snmp: fix engineBoots value on SIGHUP
5
6Upstream-Status: Pending
7
8Signed-off-by: Marian Florea <marian.florea@windriver.com>
9Signed-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 Bishop316dfdd2018-06-25 12:45:53 -040015Index: 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 Bishopd7bf8c12018-02-25 22:55:05 -050020 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 Bishop316dfdd2018-06-25 12:45:53 -040027Index: 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 Bishopd7bf8c12018-02-25 22:55:05 -050032 /*
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