* [ptxdist] [PATCH 1/2] net-snmp: drop usage of undefined Kconfig variables
@ 2013-09-03 20:29 Uwe Kleine-König
2013-09-03 20:29 ` [ptxdist] [PATCH 2/2] net-snmp: make the agent's availability via TCP/UDP configurable Uwe Kleine-König
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2013-09-03 20:29 UTC (permalink / raw)
To: ptxdist
Some variables that are used in the .make file with ifdef are not defined
in the .in file. So all ifdefs evaluate to false. Hard-code this behaviour
instead.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
rules/net-snmp.make | 65 +++++++++--------------------------------------------
1 file changed, 10 insertions(+), 55 deletions(-)
diff --git a/rules/net-snmp.make b/rules/net-snmp.make
index 24efa72..6cb0952 100644
--- a/rules/net-snmp.make
+++ b/rules/net-snmp.make
@@ -50,7 +50,16 @@ NET_SNMP_AUTOCONF := \
--enable-shared \
--disable-embedded-perl \
--without-perl-modules \
- --disable-static
+ --disable-static \
+ --disable-privacy \
+ --disable-internal-md5 \
+ --disable-agentx-dom-sock-only \
+ --disable-mib-config-checking \
+ --disable-mfd-rewrites \
+ --disable-testing-code \
+ --disable-reentrant \
+ --disable-embedded-perl \
+ --disable-ucd-snmp-compatibility
ifdef PTXCONF_ENDIAN_LITTLE
NET_SNMP_AUTOCONF += --with-endianness=little
@@ -144,60 +153,6 @@ else
NET_SNMP_AUTOCONF += --disable-developer
endif
-ifdef PTXCONF_NET_SNMP_PRIVACY
-NET_SNMP_AUTOCONF += --enable-privacy
-else
-NET_SNMP_AUTOCONF += --disable-privacy
-endif
-
-ifdef PTXCONF_NET_SNMP_INTERNAL_MD5
-NET_SNMP_AUTOCONF += --enable-internal-md5
-else
-NET_SNMP_AUTOCONF += --disable-internal-md5
-endif
-
-ifdef PTXCONF_NET_SNMP_AGENTX_DOM_SOCK_ONLY
-NET_SNMP_AUTOCONF += --enable-agentx-dom-sock-only
-else
-NET_SNMP_AUTOCONF += --disable-agentx-dom-sock-only
-endif
-
-ifdef PTXCONF_NET_SNMP_MIB_CONFIG_CHECKING
-NET_SNMP_AUTOCONF += --enable-mib-config-checking
-else
-NET_SNMP_AUTOCONF += --disable-mib-config-checking
-endif
-
-ifdef PTXCONF_NET_SNMP_MFD_REWRITES
-NET_SNMP_AUTOCONF += --enable-mfd-rewrites
-else
-NET_SNMP_AUTOCONF += --disable-mfd-rewrites
-endif
-
-ifdef PTXCONF_NET_SNMP_TESTING_CODE
-NET_SNMP_AUTOCONF += --enable-testing-code
-else
-NET_SNMP_AUTOCONF += --disable-testing-code
-endif
-
-ifdef PTXCONF_NET_SNMP_REENTRANT
-NET_SNMP_AUTOCONF += --enable-reentrant
-else
-NET_SNMP_AUTOCONF += --disable-reentrant
-endif
-
-ifdef PTXCONF_NET_SNMP_EMBEDDED_PERL
-NET_SNMP_AUTOCONF += --enable-embedded-perl
-else
-NET_SNMP_AUTOCONF += --disable-embedded-perl
-endif
-
-ifdef PTXCONF_NET_SNMP_UCD_COMPAT
-NET_SNMP_AUTOCONF += --enable-ucd-snmp-compatibility
-else
-NET_SNMP_AUTOCONF += --disable-ucd-snmp-compatibility
-endif
-
##NET_SNMP_AUTOCONF += --with-mib-modules=mibII
##NET_SNMP_AUTOCONF += --with-sys-contact=root@localhost
##NET_SNMP_AUTOCONF += --with-sys-location=unknown
--
1.8.4.rc3
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 6+ messages in thread
* [ptxdist] [PATCH 2/2] net-snmp: make the agent's availability via TCP/UDP configurable
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
2013-09-06 7:28 ` [ptxdist] [PATCH 1/2] net-snmp: drop usage of undefined Kconfig variables Uwe Kleine-König
2013-09-10 14:31 ` Alexander Dahl
2 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2013-09-03 20:29 UTC (permalink / raw)
To: ptxdist
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] [PATCH 1/2] net-snmp: drop usage of undefined Kconfig variables
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 ` [ptxdist] [PATCH 2/2] net-snmp: make the agent's availability via TCP/UDP configurable Uwe Kleine-König
@ 2013-09-06 7:28 ` Uwe Kleine-König
2013-09-10 14:31 ` Alexander Dahl
2 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2013-09-06 7:28 UTC (permalink / raw)
To: ptxdist
On Tue, Sep 03, 2013 at 10:29:46PM +0200, Uwe Kleine-König wrote:
> Some variables that are used in the .make file with ifdef are not defined
> in the .in file. So all ifdefs evaluate to false. Hard-code this behaviour
> instead.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> rules/net-snmp.make | 65 +++++++++--------------------------------------------
> 1 file changed, 10 insertions(+), 55 deletions(-)
>
> diff --git a/rules/net-snmp.make b/rules/net-snmp.make
> index 24efa72..6cb0952 100644
> --- a/rules/net-snmp.make
> +++ b/rules/net-snmp.make
> @@ -50,7 +50,16 @@ NET_SNMP_AUTOCONF := \
> --enable-shared \
> --disable-embedded-perl \
> --without-perl-modules \
> - --disable-static
> + --disable-static \
> + --disable-privacy \
> + --disable-internal-md5 \
> + --disable-agentx-dom-sock-only \
> + --disable-mib-config-checking \
> + --disable-mfd-rewrites \
> + --disable-testing-code \
> + --disable-reentrant \
> + --disable-embedded-perl \
> + --disable-ucd-snmp-compatibility
--disable-embedded-perl is duplicated here. So if otherwise you are
happy with this patch tell me, then I can fix that.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] [PATCH 1/2] net-snmp: drop usage of undefined Kconfig variables
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 ` [ptxdist] [PATCH 2/2] net-snmp: make the agent's availability via TCP/UDP configurable Uwe Kleine-König
2013-09-06 7:28 ` [ptxdist] [PATCH 1/2] net-snmp: drop usage of undefined Kconfig variables Uwe Kleine-König
@ 2013-09-10 14:31 ` Alexander Dahl
2013-09-10 19:25 ` Uwe Kleine-König
2 siblings, 1 reply; 6+ messages in thread
From: Alexander Dahl @ 2013-09-10 14:31 UTC (permalink / raw)
To: ptxdist
Hei hei,
although this is already in master, I had a look in this (after
wondering why I could not get some values from IF-MIB).
Am 2013-09-03 22:29, schrieb Uwe Kleine-König:
> Some variables that are used in the .make file with ifdef are not defined
> in the .in file. So all ifdefs evaluate to false. Hard-code this behaviour
> instead.
I see some problems with the hard coded options. I'll explain one by
one:
> --enable-shared \
> --disable-embedded-perl \
> --without-perl-modules \
> - --disable-static
> + --disable-static \
> + --disable-privacy \
> + --disable-internal-md5 \
Agreed.
> + --disable-agentx-dom-sock-only \
Handled later.
> + --disable-mib-config-checking \
Bad for the upcoming mib module handling. I'd like to see this enabled.
> + --disable-mfd-rewrites \
This is a very conservative setting. However --enable-mfd-rewrites is
rather bleeding edge. Unfortunately as far as I can see, the good ideas
mentioned on http://www.net-snmp.org/wiki/index.php/MIB_Module_ReWrites
are not implemented in 5.7 so maybe we drop this and let net-snmp find a
sane setting for each affected MIB instead of setting this globally.
> + --disable-testing-code \
Agreed.
> + --disable-reentrant \
Maybe make it configurable again?
> + --disable-embedded-perl \
> + --disable-ucd-snmp-compatibility
Agreed.
Did you have a look at `configure --help` of a recent net-snmp 5.6.x or
5.7.x?
Greets
Alex
--
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601 D1D5 8FBA 7744 CC87 10D0 ***
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] [PATCH 1/2] net-snmp: drop usage of undefined Kconfig variables
2013-09-10 14:31 ` Alexander Dahl
@ 2013-09-10 19:25 ` Uwe Kleine-König
2013-09-11 7:29 ` Alexander Dahl
0 siblings, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2013-09-10 19:25 UTC (permalink / raw)
To: ptxdist
Hallo Alex,
On Tue, Sep 10, 2013 at 04:31:44PM +0200, Alexander Dahl wrote:
> although this is already in master, I had a look in this (after
> wondering why I could not get some values from IF-MIB).
>
> Am 2013-09-03 22:29, schrieb Uwe Kleine-König:
> > Some variables that are used in the .make file with ifdef are not defined
> > in the .in file. So all ifdefs evaluate to false. Hard-code this behaviour
> > instead.
>
> I see some problems with the hard coded options. I'll explain one by
> one:
> > --enable-shared \
> > --disable-embedded-perl \
> > --without-perl-modules \
> > - --disable-static
> > + --disable-static \
> > + --disable-privacy \
> > + --disable-internal-md5 \
>
> Agreed.
>
> > + --disable-agentx-dom-sock-only \
>
> Handled later.
>
> > + --disable-mib-config-checking \
>
> Bad for the upcoming mib module handling. I'd like to see this enabled.
>
> > + --disable-mfd-rewrites \
>
> This is a very conservative setting. However --enable-mfd-rewrites is
> rather bleeding edge. Unfortunately as far as I can see, the good ideas
> mentioned on http://www.net-snmp.org/wiki/index.php/MIB_Module_ReWrites
> are not implemented in 5.7 so maybe we drop this and let net-snmp find a
> sane setting for each affected MIB instead of setting this globally.
>
> > + --disable-testing-code \
>
> Agreed.
>
> > + --disable-reentrant \
>
> Maybe make it configurable again?
You seem to assume this was configurable before but that is wrong. There
was something like
if PTXCONF_...
--enable-reentrant
else
--disable-reentrant
endif
but the variable in the if condition wasn't defined. So it didn't look
like being hardcoded to --disable-reentrant but effectively it was.
So this patch is noop and if you see a problem with the options I
hardcode now then the problem was already there before because you
couldn't change the respective variable without adding it first to
net-snmp.in.
> > + --disable-embedded-perl \
> > + --disable-ucd-snmp-compatibility
>
> Agreed.
>
> Did you have a look at `configure --help` of a recent net-snmp 5.6.x or
> 5.7.x?
No, I just dropped all ifs depending on non-existant Kconfig vars.
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [ptxdist] [PATCH 1/2] net-snmp: drop usage of undefined Kconfig variables
2013-09-10 19:25 ` Uwe Kleine-König
@ 2013-09-11 7:29 ` Alexander Dahl
0 siblings, 0 replies; 6+ messages in thread
From: Alexander Dahl @ 2013-09-11 7:29 UTC (permalink / raw)
To: ptxdist
Hei hei,
Am 2013-09-10 21:25, schrieb Uwe Kleine-König:
> You seem to assume this was configurable before but that is wrong. There
> was something like
>
> if PTXCONF_...
> --enable-reentrant
> else
> --disable-reentrant
> endif
>
> but the variable in the if condition wasn't defined. So it didn't look
> like being hardcoded to --disable-reentrant but effectively it was.
Yes, I saw this. Maybe it was some time before and someone removed it
from net-snmp.in but I didn't prove this in git history.
> So this patch is noop and if you see a problem with the options I
> hardcode now then the problem was already there before because you
> couldn't change the respective variable without adding it first to
> net-snmp.in.
Right, I already understood what you did, so if this is not the place
for this discussion I will make a new patch changing these options.
Is anyone else actually using net-snmp? This would be helpful for
discussion. ;-)
> No, I just dropped all ifs depending on non-existant Kconfig vars.
Which is useful.
Greets
Alex
--
»With the first link, the chain is forged. The first speech censured,
the first thought forbidden, the first freedom denied, chains us all
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601 D1D5 8FBA 7744 CC87 10D0 ***
--
ptxdist mailing list
ptxdist@pengutronix.de
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-09-11 7:30 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [ptxdist] [PATCH 2/2] net-snmp: make the agent's availability via TCP/UDP configurable Uwe Kleine-König
2013-09-06 7:28 ` [ptxdist] [PATCH 1/2] net-snmp: drop usage of undefined Kconfig variables 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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox