diff options
author | Li Zhou <li.zhou@windriver.com> | 2017-07-28 09:39:26 +0800 |
---|---|---|
committer | Joe MacDonald <joe_macdonald@mentor.com> | 2017-09-12 10:37:17 -0400 |
commit | 3ccb833f37b65d873b925aa640cd5603e0b4073c (patch) | |
tree | 8ebdd34450854d9625cfe7a92a686e5eb7fb2b92 /meta-networking | |
parent | 4437e03095cf8207fd8be50cbf1b5ab67b455e2d (diff) | |
download | meta-openembedded-3ccb833f37b65d873b925aa640cd5603e0b4073c.tar.gz |
net-snmp: fix engineBoots value on SIGHUP
Store the incremented engineBoots value on SIGHUP.
And don't reset engineBoots to 1 when oldEngineIDLength is 0.
For the first run, the oldEngineIDLength is 0.
When we say first run of the daemon, we talk about the
first run ever on the machine, not only first run of every boot.
Signed-off-by: Marian Florea <marian.florea@windriver.com>
Reviewed-by: Wenkuan Wang <Wenkuan.Wang@windriver.com>
Reviewed-by: Zhaolong Zhang <Zhaolong.Zhang@windriver.com>
Signed-off-by: Li Zhou <li.zhou@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
Diffstat (limited to 'meta-networking')
-rw-r--r-- | meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch | 45 | ||||
-rw-r--r-- | meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb | 1 |
2 files changed, 46 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch new file mode 100644 index 000000000..efe803876 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch | |||
@@ -0,0 +1,45 @@ | |||
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 | |||
15 | diff --git a/agent/snmpd.c b/agent/snmpd.c | ||
16 | index 056048a..12a7ea1 100644 | ||
17 | --- a/agent/snmpd.c | ||
18 | +++ b/agent/snmpd.c | ||
19 | @@ -1246,6 +1246,7 @@ receive(void) | ||
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); | ||
27 | diff --git a/snmplib/snmpv3.c b/snmplib/snmpv3.c | ||
28 | index 435cafd..6ad8208 100644 | ||
29 | --- a/snmplib/snmpv3.c | ||
30 | +++ b/snmplib/snmpv3.c | ||
31 | @@ -984,9 +984,9 @@ init_snmpv3_post_config(int majorid, int minorid, void *serverarg, | ||
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 | |||
43 | -- | ||
44 | 1.9.1 | ||
45 | |||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb index 2d6887e37..af6fd1b1f 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb | |||
@@ -30,6 +30,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \ | |||
30 | file://0002-configure-fix-a-cc-check-issue.patch \ | 30 | file://0002-configure-fix-a-cc-check-issue.patch \ |
31 | file://0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch \ | 31 | file://0003-CHANGES-BUG-2712-Fix-Perl-module-compilation.patch \ |
32 | file://0004-configure-fix-incorrect-variable.patch \ | 32 | file://0004-configure-fix-incorrect-variable.patch \ |
33 | file://net-snmp-5.7.2-fix-engineBoots-value-on-SIGHUP.patch \ | ||
33 | " | 34 | " |
34 | SRC_URI[md5sum] = "9f682bd70c717efdd9f15b686d07baee" | 35 | SRC_URI[md5sum] = "9f682bd70c717efdd9f15b686d07baee" |
35 | SRC_URI[sha256sum] = "e8dfc79b6539b71a6ff335746ce63d2da2239062ad41872fff4354cafed07a3e" | 36 | SRC_URI[sha256sum] = "e8dfc79b6539b71a6ff335746ce63d2da2239062ad41872fff4354cafed07a3e" |