Commit Graph

42 Commits

Author SHA1 Message Date
Li Zhou
3ccb833f37 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>
2017-09-12 10:37:17 -04:00
Wenlin Kang
e86c3fd9c5 net-snmp: supported cross compile for the perl embedded and perl modules
The patch solves two issues:
1. Supported cross compile for the perl embedded and perl modules.
2. Solved runtime depend issue.

Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2017-06-28 10:26:48 -04:00
Peter Kjellerstedt
0c31f55bcf Make use of the new bb.utils.filter() function
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2017-03-07 13:30:26 +01:00
Li Zhou
a0ee08d75c net-snmp: snmplib, UDPIPv6 transport: Add a missing return statement
Backport a succeeding commit from net-snmp upstream to fix the issue
introduced by commit
<BUG#a2584: Fix snmptrap to use clientaddr from snmp.conf>.
The missing return will cause crash when binding to a non-exist IPv6
address.

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>
2016-12-14 09:20:09 -05:00
Li Zhou
50169dcce2 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>
2016-12-14 09:20:09 -05:00
Khem Raj
7b05caa6a4 net-snmp: Fix build issue found with musl
limits.h is needed for PATH_MAX and NAME_MAX

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-09-26 08:29:14 +02:00
Li Wang
4fbb4d2371 net-snmp: initscripts are located in net-snmp-server-snmp package
The net-snmp-server package is a meta-package requiring
net-snmp-server-snmpd and net-snmp-server-snmptrapd package.
The net-snmp-server-snmpd package provides the startup scripts
not the meta net-snmp-server package.

Signed-off-by: Anders Wallin <anders.wallin@windriver.com>
Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-07-18 13:59:16 -04:00
Jackie Huang
582eddb44e net-snmp: fix snmpd crash via AgentX connection
backport a patch to fixed snmpd crashing when an AgentX
subagent disconnect in the middle of processing of a request.

Signed-off-by: Zhu Yanjun <yanjun.zhu@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-07-18 13:59:16 -04:00
Ross Burton
275b6c30fb meta-networking: use bb.utils.contains() instead of base_contains()
base_contains() is a compatibility wrapper and may warn in the future, so
replace all instances with bb.utils.contains().

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-05-05 11:41:28 -04:00
Zhu Yanjun
73fa6a9912 net-snmp: enable ipv6 support
Add packageconfig for ipv6 and enable it when it's defined in distro_features.

Signed-off-by: Zhu Yanjun <yanjun.zhu@windriver.com>
Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-05-05 17:19:57 +02:00
Catalin Enache
30e21dc10f net-snmp: fix some invalid paths
Because the package is not built in place @srcdir@ is
an absolute path to the source directory instead of ".".

Because of this some target scripts like  net-snmp-create-v3-user
and net-snmp-config that are using thisvariable in their *.in
files (NSC_SRCDIR=@srcdir@) contain invalid paths.

Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-04-01 12:05:27 -04:00
Catalin Enache
21ded2ca9c net-snmp: fix invalid paths in target net-snmp-config
Only net-snmp-config used for sysroot should have sysroot
specific paths.

Signed-off-by: Catalin Enache <catalin.enache@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-04-01 12:05:27 -04:00
Martin Jansa
df7242fddb recipes: Replace "cp -a" with "cp -R --no-dereference --preserve=mode,links"
* Using "cp -a" leaks UID of user running the builds, causing
  many QA warnings.
* See this thread for details:
  http://lists.openembedded.org/pipermail/openembedded-core/2015-November/112904.html

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2016-03-04 09:06:22 +01:00
Stephen Arnold
dafd61fa87 net-snmp: fix cross-compile breakage, add libnl pkgconfig option
This patch enhances a previously unapplied patch on jethro, plus adds
some flexibility in terms of required deps and a few cleanups.

Signed-off-by: Stephen Arnold <stephen.arnold42@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-02-22 15:51:20 -05:00
Roy Li
6e0d1732ed net-snmp: fix the replacement in net-snmp-config
when net-snmp-config is used to configure by other package, and fail since
/libnl3 is not found, in fact, it should be -I/usr/include/libnl3, and is
modified as /libnl3 incorrectly.

instead of modify the net-snmp-config for target, the one under
${bindir_crossscripts} should be replaced with ${TAGING_INCDIR}

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-01-05 12:43:33 -05:00
Rafaël Carré
8d1ce255bc net-snmp: apply patch for cross-compilation
7fb5479 added the patch but did not apply it
Rename patch to explicit it differentiate it from other patches

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-01-04 17:27:32 -05:00
Rafaël Carré
9f2e7df9a7 net-snmp: apply patch for cross-compilation
7fb5479 added the patch but did not apply it

Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2016-01-04 12:58:10 -05:00
Rafaël Carré
7fb5479fb8 net-snmp: fix cross compilation
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-11-30 12:50:41 -05:00
Li Xin
ef4b0c6c5d net-snmp: Modify snmpd.service
Add "-a" parameter in snmpd.service,it is needed to address logs.

Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-11-30 12:50:24 -05:00
Khem Raj
c0a865d4ef net-snmp: Fix build with gcc5
Fix errors seen with gcc5

Change-Id: I9c4361f3a9c25342f5c740263f551c162dce8faf
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-10-21 15:59:03 -04:00
Li xin
858d7a83cb net-snmp: upgrade 5.7.2.1 -> 5.7.3
* Dropped backported patches
  --ifmib.patch
  --0001-Added-checks-for-printing-variables-with-wrong-types.patch
  --0001-Fix-CVE-2014-2285.patch
  --net-snmp-5.7.2-fix-mib-timeout-values.patch

* Update patches
  --dont-return-incompletely-parsed-varbinds.patch
  --systemd-support.patch

* Add a new patch to avoid build Errors.
  --0001-config_os_headers-Error-Fix.patch

Signed-off-by: Li Xin <lixin.fnst@cn.fujitsu.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-09-11 11:52:15 -04:00
Roy Li
96b36e6975 net-snmp: fix mib representation of timeout values
Fix mib representation of timeout values,correct conversion
factor from microseconds to centiseconds.

Signed-off-by: Wenlin Kang <wenlin.kang@windriver.com>
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-08-06 15:44:10 -04:00
Jian Liu
8e642c32bb net-snmp: don't return incompletely parsed varbinds
the snmp_pdu_parse() function could leave incompletely parsed varBind
variables in the list of variables in case the parsing of the SNMP
PDU failed. If later processing tries to operate on the stale and
incompletely processed varBind (e.g. when printing the variables),
this can lead to e.g. crashes or, possibly, execution of arbitrary
code.

The snmp_pdu_parse() function stores varBind variables in a list of
netsnmp_variable_list structures. Each time the function parses a new
varBind, a new netsnmp_variable_list item is allocated on the heap
and linked to the list of variables. The problem is that this item
is not removed from the list, even if snmp_pdu_parse() fails to
complete the parsing.

The "type" member of the stale netsnmp_variable_list is not
properly initialized in case snmp_pdu_parse() returns early from the
parsing. However, the "type" member is used to determine later code
paths, which is why we see crashes in a variety of functions,
although the root cause for all of these is the same.

This patch come from
f23bcd3ac6/

Written-by: Robert Story
Signed-off-by: Jian Liu <jian.liu@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-07-16 09:56:40 -04:00
Joe MacDonald
8980f0d2a2 meta-networking: standardize SECTION values
SECTION has been used inconsistently throughout the recipes in this layer.
Convert them to all use the same convention.

Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-06-05 20:42:25 -04:00
Junling Zheng
ff3c52f44d net-snmp: fix CVE-2014-2285
The perl_trapd_handler function in perl/TrapReceiver/TrapReceiver.xs in
Net-SNMP 5.7.3.pre3 and earlier, when using certain Perl versions, allows
remote attackers to cause a denial of service (snmptrapd crash) via an
empty community string in an SNMP trap, which triggers a NULL pointer
dereference within the newSVpv function in Perl.

Refer to: https://bugzilla.redhat.com/show_bug.cgi?id=1072044

Signed-off-by: Junling Zheng <zhengjunling@huawei.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-05-08 15:40:28 -04:00
Jackie Huang
5eec0615e5 net-snmp: add ptest package
Issue: TA79430

- Change to use append for PACKAGES so that:
  * ptest package is added from ptest bbcalss
  * the PN is back, allow empty and add rdepends on net-snmp-client
    in case the user try to add net-snmp to the image
- Add a patch to fix the output format for ptest
- Add run-ptest
- Add rdepends on perl for ptest

(LOCAL REV: NOT UPSTREAM) -- Sent to meta-networking on 20150114

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-03-11 19:29:34 -04:00
Jackie Huang
ebdd38e7f7 net-snmp: move net-snmp-config to client package
Since net-snmp-config is a common tool, move it from dev package
to client package.

Signed-off-by: yzhu1 <yanjun.zhu@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-03-11 19:27:43 -04:00
Jackie Huang
a959290302 net-snmp: init script fixes
Changes:
1. Add source function and status command.
2. make it possible to change the start arguments with a default file
   in the same way as debian.
3. change the default INITSCRIPT_PARAMS
4. Add PIDFILE and fix restart
5. remove the postrm sicne we use the one from update-rc.d

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-03-11 19:27:43 -04:00
Jackie Huang
3e6e606cdc net-snmp: fix "libtool --finish"
LIB_LDCONFIG_CMD failed since it is using a host dir $(libdir)
which is /usr/lib64 does not exist on host when compile 64bit
image.

In fact, configuring dynamic linker run-time bindings is meaningless
at this step,  If it is needed, Poky would write ldconfig scripts to
rpm-postinst for each recipe while do_package, in package.bbclass.

Signed-off-by: Roy.Li <rongqing.li@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-03-11 19:19:32 -04:00
Jackie Huang
356c792b1b net-snmp: move persistent dir to /var/lib/net-snmp
Move persistent dir to /var/lib/net-snmp and fix security contexts for
them.

Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-03-11 19:18:08 -04:00
Jackie Huang
88a9836158 net-snmp: have mib-modules=smux enabled
According to the following commit, net-snmp needs to have
mib-modules=smux enabled:
commit f64db3011c
Author: Aws Ismail <aws.ismail@windriver.com>
Date:   Mon Mar 25 11:30:06 2013 -0400

    Quagga has no snmp support, unrecognized options --enable-tcp-md5

    1. Quagga's tcp-md5 has been renamed to linux24-tcp-md5

    2. net-snmp needs to have mib-modules=smux enabled to enable
    quagga to support snmp. Make the net-snmp option dependent
    on the DISTRO_FEATURE snmp.

    3. Misc: install the sample conf files for quagga. Also,
    Make sure that the post install script is being run
    on the target rather than during the rootfs creation
    stage.

    Signed-off-by: Amy Fong <amy.fong@windriver.com>
    Signed-off-by: Aws Ismail <aws.ismail@windriver.com>
    Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-03-11 19:18:08 -04:00
Chong.Lu@windriver.com
c299c5a74c net-snmp: add knob whether nlist.h are checked
Previously, it still was checked when there was no nlish.h in sysroots directory.
Add knob to decide whether nlist.h are checked or not.

Fixed by using PACKAGECONFIG to check elf, with default disabled set.

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-03-11 19:18:07 -04:00
Bian Naimeng
4e08e7c3a5 snmpd: instead option -LS by -Ls
Option -LS does not work, we should instead it by -Ls as usage said.

 Deprecated options:
   -l FILE               use -Lf <FILE> instead
   -P                    use -p instead
   -s                    use -Lsd instead
   -S d|i|0-7            use -Ls <facility> instead

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2015-02-11 21:27:29 -05:00
Roy Li
4bb8bb5e47 net-snmp: fix for Security Advisory - CVE-2014-3565
snmplib/mib.c in net-snmp 5.7.0 and earlier, when the -OQ option is used,
allows remote attackers to cause a denial of service (snmptrapd crash) via
a crafted SNMP trap message, which triggers a conversion to the variable
type designated in the MIB file, as demonstrated by a NULL type in an ifMtu
trap message.

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-3565

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2014-11-04 16:01:01 -05:00
Jackie Huang
c78397ecdf net-snmp: add ac_cv_header_valgrind_* to CACHED_CONFIGUREVARS
There have been occasions that net-snmp sees valgrind and then later it's
not available, adding this setting ensures determinism by disabling it by
default

Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Joe MacDonald <joe_macdonald@mentor.com>
2014-10-21 15:07:12 -04:00
Roy Li
434d5d8d6c net-snmp: uprev it to 5.7.2.1
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2014-08-13 23:28:06 +02:00
Alexandre Fournier
c4ba56ceeb net-snmp: install net-snmp-config script to STAGING_BINDIR_CROSS
This recipe was installing net-snmp-config script to STAGING_BINDIR
instead of STAGING_BINDIR_CROSS, during the do_install. It is not
recommended and must be done after staging.

Changes:
* Remove STAGING_BINDIR manipulations from do_install_append
* Add net_snmp_sysroot_preprocess function instead
* Append net_snmp_sysroot_preprocess to SYSROOT_PREPROCESS_FUNCS

Signed-off-by: Alexandre Fournier <alexandre.fournier@kiplink.fr>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2014-06-03 21:18:51 -04:00
yzhu1
9747141c09 net-snmp-5.7.2: fix CVE-2014-2285
The perl_trapd_handler function in perl/TrapReceiver/TrapReceiver.xs
in Net-SNMP 5.7.3.pre3 and earlier, when using certain Perl versions,
allows remote attackers to cause a denial of service (snmptrapd
crash) via an empty community string in an SNMP trap, which triggers
a NULL pointer dereference within the newSVpv function in Perl.

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-2285
Signed-off-by: yzhu1 <yanjun.zhu@windriver.com>
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2014-05-09 10:18:40 -04:00
yanjun.zhu
7361149c47 net-snmp-5.7.2: fix CVE-2014-2284
The Linux implementation of the ICMP-MIB in Net-SNMP 5.5 before
5.5.2.1, 5.6.x before 5.6.2.1, and 5.7.x before 5.7.2.1 does
not properly validate input, which allows remote attackers
to cause a denial of service via unspecified vectors.

http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2014-2284
Signed-off-by: yanjun.zhu <yanjun.zhu@windriver.com>
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2014-05-09 10:18:40 -04:00
Yue Tao
b9ad53ccce net-snmp: Using the target perl
Set the PERLPROG to target perl to avoid host contamination.

Signed-off-by: Yue Tao <Yue.Tao@windriver.com>
Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Joe MacDonald <joe@deserted.net>
2014-05-09 10:18:40 -04:00
Thomas Fitzsimmons
b57465fc8c net-snmp: Backport fix for NETSNMP_NO_SYSTEMD typos
Added Signed-off-by for backport patch refresh.  Bumped PR.

Signed-off-by: Thomas Fitzsimmons <fitzsim@cisco.com>
Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com>
2013-06-10 11:18:38 -04:00
Paul Eggleton
9e7327e446 net-snmp: move to meta-networking and tweak
* Set SUMMARY instead of DESCRIPTION
* Move SRC_URI checksums under SRC_URI
* Move packaging definitions to the end

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
2013-04-26 10:00:32 +02:00