# net-snmp port upgrade build error on fbsd 7.0



## ardya (Nov 16, 2008)

Anyone else having problems upgrading the net-snmp port?
After updating ports tree with portsnap fetch update, I run pkg_version -l '<' and that shows net-snmp is upgradable.

pkg_version -l '<'
net-snmp                            <

Next I run pkg_replace net-snmp and get:

pkg_replace net-snmp
--->  Replacing 'net-snmp-5.3.2_3' with 'net-snmp-5.3.2.3'
--->  Building '/usr/ports/net-mgmt/net-snmp53'

You may use the following build options:

WITH_INETADDRESS_HACK=yes       builds with the inetaddress hack
WITH_TKMIB=yes          Install a graphical Perl/Tk/SNMP based mib browser
WITHOUT_DUMMY_VALUES=yes        Provide 'placeholder' dummy values where
                                the necessary information is not available.
WITHOUT_PERL=yes                Do not install the perl modules along with the rest
                                of the net-snmp toolkit.
WITHOUT_IPV6=yes                Disable IPv6.

DEFAULT_SNMP_VERSION="3"        Default version of SNMP to use.
NET_SNMP_SYS_CONTACT="nobody@nowhere.invalid"
                                Default system contact.
NET_SNMP_SYS_LOCATION="somewhere"
                                Default system location.
NET_SNMP_LOGFILE="/var/log/snmpd.log"
                                Default log file location for snmpd.
NET_SNMP_PERSISTENTDIR="/var/net-snmp"
                                Default directory for persistent data storage.
NET_SNMP_MIB_MODULES="host disman/event-mib smux mibII/mta_sendmail mibII/tcpTable ucd-snmp/diskio"
                                Optional mib modules that can be built into the
                                agent

===>  net-snmp-5.3.2.3 has known vulnerabilities:
=> net-snmp -- DoS for SNMP agent via crafted GETBULK request.
   Reference: <http://www.FreeBSD.org/ports/portaudit/daf045d7-b211-11dd-a987-000c29ca8953.html>
=> Please update your ports tree and try again.
*** Error code 1

Stop in /usr/ports/net-mgmt/net-snmp53.
** Command failed (exit code 1): make UPGRADE_PKG=net-snmp-5.3.2_3 UPGRADE_PKG_VER=5.3.2_3
** Fix the problem and try again.

--->  Processed 1: 0 done, 0 ignored, 0 skipped, 1 failed


uname -a
FreeBSD ws.int.kritek.net 7.0-RELEASE-p5 FreeBSD 7.0-RELEASE-p5 #2: Fri Oct  3 01:07:50 EDT 2008     root@ws.int.kritek.net:/usr/obj/usr/src/sys/WS-CURRENT  i386


----------



## royce (Nov 16, 2008)

The warning is telling you that version 5.3.2.3 of net-snmp has security vulnerabilities.  The most recent version that I see in the ports tree is 5.4.2.1.

How recent is your ports tree?


----------



## ardya (Nov 16, 2008)

I updated it just before I ran pkg_version -l '<' with portsnap fetch update.


----------



## royce (Nov 16, 2008)

Ah, then you're probably using the specific net-snmp53 port.

Your options to get up and running, then, are to either:

1) Override the security warning (not recommended), or

2) Encourage patches to secure the net-snmp53 port, or

3) Switch to using the 5.4.x tree of net-snmp.


Option #3 is probably easiest; is moving to 5.4.x feasible for your situation?


----------



## ardya (Nov 16, 2008)

Moving to another is feasible, but looking in /usr/ports/net-mgmt and not seeing net-snmp54...is the 5.4 tree called something else?

I pkg_deleted 5.3x, and am running make in net-snmp/
It grabbed the 5.4x tree, building now

Thanks for the direction and help


----------



## royce (Nov 16, 2008)

It's just net-snmp - 5.4.x is the default branch now.


```
$ locate net-snmp|grep pkg-descr
/usr/ports/net-mgmt/net-snmp/pkg-descr
/usr/ports/net-mgmt/net-snmp-tkmib/pkg-descr
/usr/ports/net-mgmt/net-snmp4/pkg-descr
/usr/ports/net-mgmt/net-snmp53/pkg-descr

$ grep ^PORTVERSION /usr/ports/net-mgmt/net-snmp/Makefile
PORTVERSION=    5.4.2.1
```


----------



## Infracaninophile (Nov 16, 2008)

make -V PKGNAME


----------



## ardya (Nov 16, 2008)

The problem is resolved, thanks guys.


----------



## solskogen (Nov 17, 2008)

Mine wont compile on FreeBSD 7.0:

===>  Building for net-snmp-5.4.2.1
making all in /tmp/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/snmplib
making all in /tmp/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/agent
making all in /tmp/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/agent/helpers
making all in /tmp/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/agent/mibgroup
/bin/sh ../../libtool --mode=compile cc -I../../include -I. -I../../agent -I../../agent/mibgroup  -I../../snmplib   -DNETSNMP_ENABLE_IPV6 -O2 -pipe -fno-strict-aliasing -Ufreebsd7 -Dfreebsd7=freebsd7  -DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include  -I/usr/local/lib/perl5/5.8.8/mach/CORE -c -o if-mib/data_access/interface.lo if-mib/data_access/interface.c
 cc -I../../include -I. -I../../agent -I../../agent/mibgroup -I../../snmplib -DNETSNMP_ENABLE_IPV6 -O2 -pipe -fno-strict-aliasing -Ufreebsd7 -Dfreebsd7=freebsd7 -DAPPLLIB_EXP=/usr/local/lib/perl5/5.8.8/BSDPAN -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -I/usr/local/lib/perl5/5.8.8/mach/CORE -c if-mib/data_access/interface.c  -fPIC -DPIC -o if-mib/data_access/.libs/interface.o
if-mib/data_access/interface.c:9:46: error: if-mib/ifTable/ifTable_constants.h: No such file or directory
if-mib/data_access/interface.c: In function 'netsnmp_access_interface_entry_guess_speed':
if-mib/data_access/interface.c:660: error: 'IANAIFTYPE_ETHERNETCSMACD' undeclared (first use in this function)
if-mib/data_access/interface.c:660: error: (Each undeclared identifier is reported only once
if-mib/data_access/interface.c:660: error: for each function it appears in.)
if-mib/data_access/interface.c:662: error: 'IANAIFTYPE_SOFTWARELOOPBACK' undeclared (first use in this function)
if-mib/data_access/interface.c:664: error: 'IANAIFTYPE_ISO88025TOKENRING' undeclared (first use in this function)
if-mib/data_access/interface.c: In function '_free_interface_config':
if-mib/data_access/interface.c:778: warning: passing argument 1 of 'free' discards qualifiers from pointer target type
*** Error code 1

Stop in /tmp/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/agent/mibgroup.
*** Error code 1

Stop in /tmp/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1/agent.
*** Error code 1

Stop in /tmp/usr/ports/net-mgmt/net-snmp/work/net-snmp-5.4.2.1.
*** Error code 1

Stop in /usr/ports/net-mgmt/net-snmp.


----------

