From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: ptxdist@pengutronix.de
Subject: [ptxdist] [PATCH 2/2] net-snmp: make the agent's availability via TCP/UDP configurable
Date: Tue, 3 Sep 2013 22:29:47 +0200 [thread overview]
Message-ID: <1378240187-21469-2-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <1378240187-21469-1-git-send-email-u.kleine-koenig@pengutronix.de>
This needs a patch to net-snmp's autoconf magic because without it it makes
no difference if you pass --enable-agentx-dom-sock-only or --disable-...; in
both cases only domain sockets were allowed. So default to the conservative
setting as this is what older builds resulted in.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
.../0002-really-disable-dom-sock-only.patch | 36 ++++++++++++++++++++++
patches/net-snmp-5.6.1/autogen.sh | 1 +
patches/net-snmp-5.6.1/series | 1 +
rules/net-snmp.in | 5 +++
rules/net-snmp.make | 2 +-
5 files changed, 44 insertions(+), 1 deletion(-)
create mode 100644 patches/net-snmp-5.6.1/0002-really-disable-dom-sock-only.patch
create mode 120000 patches/net-snmp-5.6.1/autogen.sh
diff --git a/patches/net-snmp-5.6.1/0002-really-disable-dom-sock-only.patch b/patches/net-snmp-5.6.1/0002-really-disable-dom-sock-only.patch
new file mode 100644
index 0000000..000c05d
--- /dev/null
+++ b/patches/net-snmp-5.6.1/0002-really-disable-dom-sock-only.patch
@@ -0,0 +1,36 @@
+From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de>
+Date: Tue, 3 Sep 2013 21:12:46 +0200
+Subject: [PATCH] Don't disable udp and tcp when --disable-agentx-dom-sock-only is given
+
+The configure magic without this patch treats all
+
+ --enable-agentx-dom-sock-only
+ --enable-agentx-dom-sock-only=no
+ --disable-agentx-dom-sock-only
+
+the same; i.e. disables the udp and tcp transports. With this patch only the
+first option does have this effect which matches the usual and expected
+semantic.
+---
+ configure.d/config_project_with_enable | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/configure.d/config_project_with_enable b/configure.d/config_project_with_enable
+index 069cc07..6ad3af8 100644
+--- a/configure.d/config_project_with_enable
++++ b/configure.d/config_project_with_enable
+@@ -692,9 +692,11 @@ NETSNMP_ARG_ENABLE(local-smux,
+ fi])
+
+ NETSNMP_ARG_ENABLE(agentx-dom-sock-only,
+-[ --enable-agentx-dom-sock-only Disable UDP/TCP transports for agentx.],
+-AC_DEFINE(NETSNMP_AGENTX_DOM_SOCK_ONLY, 1,
+- [define if agentx transport is to use domain sockets only]))
++[ --enable-agentx-dom-sock-only Disable UDP/TCP transports for agentx.])
++if test "x$enable_agentx_dom_sock_only" = "xyes"; then
++ AC_DEFINE(NETSNMP_AGENTX_DOM_SOCK_ONLY, 1,
++ [define if agentx transport is to use domain sockets only])
++fi
+
+ NETSNMP_ARG_ENABLE(snmptrapd-subagent,
+ [ --disable-snmptrapd-subagent Disable agentx subagent code in snmptrapd.])
diff --git a/patches/net-snmp-5.6.1/autogen.sh b/patches/net-snmp-5.6.1/autogen.sh
new file mode 120000
index 0000000..9f8a4cb
--- /dev/null
+++ b/patches/net-snmp-5.6.1/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh
\ No newline at end of file
diff --git a/patches/net-snmp-5.6.1/series b/patches/net-snmp-5.6.1/series
index 89093b4..326b72f 100644
--- a/patches/net-snmp-5.6.1/series
+++ b/patches/net-snmp-5.6.1/series
@@ -1 +1,2 @@
0001-net-snmp-config-add-SYSROOT-support.patch -p0
+0002-really-disable-dom-sock-only.patch
diff --git a/rules/net-snmp.in b/rules/net-snmp.in
index 6205a19..1ddc293 100644
--- a/rules/net-snmp.in
+++ b/rules/net-snmp.in
@@ -118,4 +118,9 @@ config NET_SNMP_MIB_INSTALL_DIR
string
default "/usr/share/snmp/mibs"
+config NET_SNMP_DOM_SOCK_ONLY
+ bool "Only allow domain socket connections to the agent" if NET_SNMP_AGENT
+ default y
+ help
+ Enable this to disable TCP and UDP connections to the agent.
endif
diff --git a/rules/net-snmp.make b/rules/net-snmp.make
index 6cb0952..f7c0262 100644
--- a/rules/net-snmp.make
+++ b/rules/net-snmp.make
@@ -53,7 +53,7 @@ NET_SNMP_AUTOCONF := \
--disable-static \
--disable-privacy \
--disable-internal-md5 \
- --disable-agentx-dom-sock-only \
+ --$(call ptx/endis, PTXCONF_NET_SNMP_DOM_SOCK_ONLY)-agentx-dom-sock-only \
--disable-mib-config-checking \
--disable-mfd-rewrites \
--disable-testing-code \
--
1.8.4.rc3
--
ptxdist mailing list
ptxdist@pengutronix.de
next prev parent reply other threads:[~2013-09-03 20:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-03 20:29 [ptxdist] [PATCH 1/2] net-snmp: drop usage of undefined Kconfig variables Uwe Kleine-König
2013-09-03 20:29 ` Uwe Kleine-König [this message]
2013-09-06 7:28 ` Uwe Kleine-König
2013-09-10 14:31 ` Alexander Dahl
2013-09-10 19:25 ` Uwe Kleine-König
2013-09-11 7:29 ` Alexander Dahl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1378240187-21469-2-git-send-email-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox