summaryrefslogtreecommitdiffstats
path: root/meta-networking
diff options
context:
space:
mode:
authorLi Zhou <li.zhou@windriver.com>2016-11-23 12:10:39 +0800
committerArmin Kuster <akuster808@gmail.com>2017-01-29 19:29:17 -0500
commit52a4839bf725993c90ea48f7b118770ae6e247d8 (patch)
treed668e0d0f7c8119a2c92eca43709008ace58295b /meta-networking
parent6cedb8409996ec5efb0ba3a14913f368bd517cbd (diff)
downloadmeta-openembedded-52a4839bf725993c90ea48f7b118770ae6e247d8.tar.gz
net-snmp: fix snmptrap to use clientaddr from snmp.conf.
Under IPv6 IP-multihomed environment, the socket does not bind to the clientaddr indicated in snmp.conf when sending snmptrap and it might choose a random one. Backport the patch from net-snmp upstream to fix it. 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> Signed-off-by: Armin Kuster <akuster808@gmail.com>
Diffstat (limited to 'meta-networking')
-rw-r--r--meta-networking/recipes-protocols/net-snmp/net-snmp/0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch48
-rw-r--r--meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb1
2 files changed, 49 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch
new file mode 100644
index 000000000..b05eea56f
--- /dev/null
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch
@@ -0,0 +1,48 @@
1From a92628a163ebf1ea62220684736300461c003875 Mon Sep 17 00:00:00 2001
2From: Niels Baggesen <nba@users.sourceforge.net>
3Date: Mon, 26 Jan 2015 20:26:06 +0100
4Subject: [PATCH] BUG#a2584: Fix snmptrap to use clientaddr from snmp.conf.
5 Thanks to rizwan
6
7Upstream-Status: backport
8
9Signed-off-by: Li Zhou <li.zhou@windriver.com>
10---
11 snmplib/transports/snmpUDPIPv6Domain.c | 21 +++++++++++++++++++++
12 1 file changed, 21 insertions(+)
13
14diff --git a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c
15index 55e3610..aca69ae 100644
16--- a/snmplib/transports/snmpUDPIPv6Domain.c
17+++ b/snmplib/transports/snmpUDPIPv6Domain.c
18@@ -256,6 +256,27 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local)
19 t->data = NULL;
20 t->data_length = 0;
21 } else {
22+ char *client_socket = NULL;
23+ /*
24+ * This is a client session. If we've been given a
25+ * client address to send from, then bind to that.
26+ * Otherwise the send will use "something sensible".
27+ */
28+
29+ client_socket = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
30+ NETSNMP_DS_LIB_CLIENT_ADDR);
31+ if (client_socket) {
32+ struct sockaddr_in6 client_addr;
33+ netsnmp_sockaddr_in6_2(&client_addr, client_socket, NULL);
34+ rc = bind(t->sock, (struct sockaddr *)&client_addr,
35+ sizeof(struct sockaddr_in6));
36+ if ( rc != 0 ) {
37+ DEBUGMSGTL(("netsnmp_udp6", "failed to bind for clientaddr: %d %s\n",
38+ errno, strerror(errno)));
39+ netsnmp_socketbase_close(t);
40+ netsnmp_transport_free(t);
41+ }
42+ }
43 /*
44 * This is a client session. Save the address in the
45 * transport-specific data pointer for later use by netsnmp_udp6_send.
46--
472.9.3
48
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 1997d5cd0..140028722 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
@@ -24,6 +24,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.zip \
24 file://0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch \ 24 file://0001-snmplib-keytools.c-Don-t-check-for-return-from-EVP_M.patch \
25 file://net-snmp-agentx-crash.patch \ 25 file://net-snmp-agentx-crash.patch \
26 file://0001-get_pid_from_inode-Include-limit.h.patch \ 26 file://0001-get_pid_from_inode-Include-limit.h.patch \
27 file://0001-BUG-a2584-Fix-snmptrap-to-use-clientaddr-from-snmp.c.patch \
27 " 28 "
28SRC_URI[md5sum] = "9f682bd70c717efdd9f15b686d07baee" 29SRC_URI[md5sum] = "9f682bd70c717efdd9f15b686d07baee"
29SRC_URI[sha256sum] = "e8dfc79b6539b71a6ff335746ce63d2da2239062ad41872fff4354cafed07a3e" 30SRC_URI[sha256sum] = "e8dfc79b6539b71a6ff335746ce63d2da2239062ad41872fff4354cafed07a3e"