--===============0639013139==
Content-Type: multipart/alternative; boundary="0-937911753-1182975217=:85207"
Content-Transfer-Encoding: 8bit

--0-937911753-1182975217=:85207
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I think the way the structures are being initialized looks odd to me ....


Here is the original routine code:

static int netsnmp_udp_sendto(int fd, struct in_addr *srcip, struct sockaddr *remote,
char *data, int len)
{
struct iovec iov = { data, len };
struct {
struct cmsghdr cm;
struct in_pktinfo ipi;
} cmsg = {
.cm = {
.cmsg_len = sizeof(struct cmsghdr) + sizeof(struct in_pktinfo),
.cmsg_level = SOL_IP,
.cmsg_type = IP_PKTINFO,
},
.ipi = {
.ipi_ifindex = 0,
.ipi_spec_dst = srcip ? srcip->s_addr : 0,
},
};
struct msghdr m = {
.msg_name = remote,
.msg_namelen = sizeof(struct sockaddr_in),
.msg_iov = &iov,
.msg_iovlen = 1,
.msg_control = &cmsg,
.msg_controllen = sizeof(cmsg),
.msg_flags = 0,
};
return sendmsg(fd, &m, MSG_NOSIGNAL|MSG_DONTWAIT);
}







Need Help wrote: I am trying to compile NetSNMP 5.4 into my build environment using our "mipsel-uclibc-g++" compiler, however, compiler errors are being generated in the "snmpUDPDomain.c" file.

I searched for this error on the internet and found that the code was inserted as part of a patch I think. Please see the email attached to this post for the description of the code inserted. Perhaps I am the first one trying to compile this code with the g++ compiler?

If someone could indicate how I should fix this error, I would be much appreciated.

Here is the compiler error generated:
(*** Note: I also attached the "snmpUDPDomain.c" file for reference)


/bin/sh ../libtool --mode=compile mipsel-uclibc-g++ -I../include -I/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/include -I. -I../snmplib -I/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/snmplib -g -O2 -Ulocalhost -Dlocalhost=localhost -c -o snmpUDPDomain.lo snmpUDPDomain.c
mipsel-uclibc-g++ -I../include -I/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/include -I. -I../snmplib -I/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/snmplib -g -O2 -Ulocalhost -Dlocalhost=localhost -c snmpUDPDomain.c -o snmpUDPDomain.o
snmpUDPDomain.c: In function `int netsnmp_udp_sendto(int, in_addr*, sockaddr*,
char*, int)':
snmpUDPDomain.c:163: error: parse error before `.' token
snmpUDPDomain.c:168: error: parse error before `.' token
snmpUDPDomain.c: At global scope:
snmpUDPDomain.c:174: error: parse error before `.' token
snmpUDPDomain.c:182: error: parse error before `return'
snmpUDPDomain.c: In function `int netsnmp_udp_recv(netsnmp_transport*, void*,
int, void**, int*)':
snmpUDPDomain.c:214: error: invalid conversion from `void*' to `char*'
snmpUDPDomain.c: In function `int netsnmp_udp_send(netsnmp_transport*, void*,
int, void**, int*)':
snmpUDPDomain.c:267: error: invalid conversion from `void*' to `char*'
make[2]: *** [snmpUDPDomain.lo] Error 1
make[2]: Leaving directory `/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/snmplib'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp'
make: *** [net-snmp-make] Error 2





---------------------------------
Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out. >From jandres at gmx.net Fri Feb 9 22:15:06 2007
From: jandres at gmx.net (Jan Andres)
Date: Sat Feb 10 12:48:31 2007
Subject: [Pkg-net-snmp-devel] [Patch] net-snmp 5.3.1-2: 24_pktinfo.patch
breaks TCP
Message-ID: <20070209211506.GA6381@pitr.home.jan>

Hi,

With 24_pktinfo.patch applied snmpd will never respond to TCP
requests, because the address -> security name mapping always fails.

I propose the patch attached as a replacement for 24_pktinfo.patch. It's
the version of the fix as diffed from the V5-3-patches branch of net-snmp,
and includes the fix for the TCP code.

Regards,
Jan

--
Jan Andres
-------------- next part --------------
diff -ur net-snmp-5.3.1/snmplib/snmpTCPDomain.c net-snmp-5.3.1-fixed/snmplib/snmpTCPDomain.c
--- net-snmp-5.3.1/snmplib/snmpTCPDomain.c 2005-09-16 12:30:48.000000000 +0200
+++ net-snmp-5.3.1-fixed/snmplib/snmpTCPDomain.c 2007-02-09 20:52:29.112680146 +0100
@@ -44,6 +44,12 @@
#include
#include

+/* Copied from snmpUDPDomain.c */
+typedef struct netsnmp_udp_addr_pair_s {
+ struct sockaddr_in remote_addr;
+ struct in_addr local_addr;
+} netsnmp_udp_addr_pair;
+
oid netsnmp_snmpTCPDomain[] = { TRANSPORT_DOMAIN_TCP_IP };
static netsnmp_tdomain tcpDomain;

@@ -55,18 +61,23 @@
static char *
netsnmp_tcp_fmtaddr(netsnmp_transport *t, void *data, int len)
{
- struct sockaddr_in *to = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;

- if (data != NULL && len == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr_in *) data;
- } else if (t != NULL && t->data != NULL &&
- t->data_length == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr_in *) t->data;
+ if (data != NULL && len == sizeof(netsnmp_udp_addr_pair)) {
+ addr_pair = (netsnmp_udp_addr_pair *) data;
+ } else if (t != NULL && t->data != NULL) {
+ addr_pair = (netsnmp_udp_addr_pair *) t->data;
}
- if (to == NULL) {
+
+ if (addr_pair == NULL) {
return strdup("TCP: unknown");
} else {
- char tmp[64];
+ struct sockaddr_in *to = NULL;
+ char tmp[64];
+ to = (struct sockaddr_in *) &(addr_pair->remote_addr);
+ if (to == NULL) {
+ return strdup("TCP: unknown");
+ }

sprintf(tmp, "TCP: [%s]:%hd",
inet_ntoa(to->sin_addr), ntohs(to->sin_port));
@@ -163,19 +174,21 @@
netsnmp_tcp_accept(netsnmp_transport *t)
{
struct sockaddr *farend = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;
int newsock = -1, sockflags = 0;
socklen_t farendlen = sizeof(struct sockaddr_in);
char *str = NULL;

- farend = (struct sockaddr *) malloc(sizeof(struct sockaddr_in));
+ addr_pair = (netsnmp_udp_addr_pair *)malloc(sizeof(netsnmp_udp_addr_pair));

- if (farend == NULL) {
+ if (addr_pair == NULL) {
/*
* Indicate that the acceptance of this socket failed.
*/
DEBUGMSGTL(("netsnmp_tcp", "accept: malloc failed\n"));
return -1;
}
+ farend = (struct sockaddr_in *) &(addr_pair->remote_addr);

if (t != NULL && t->sock >= 0) {
newsock = accept(t->sock, farend, &farendlen);
@@ -191,8 +204,8 @@
free(t->data);
}

- t->data = farend;
- t->data_length = farendlen;
+ t->data = addr_pair;
+ t->data_length = sizeof(netsnmp_udp_addr_pair);
str = netsnmp_tcp_fmtaddr(NULL, farend, farendlen);
DEBUGMSGTL(("netsnmp_tcp", "accept succeeded (from %s)\n", str));
free(str);
@@ -238,6 +251,7 @@
netsnmp_tcp_transport(struct sockaddr_in *addr, int local)
{
netsnmp_transport *t = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;
int rc = 0;


@@ -251,13 +265,14 @@
}
memset(t, 0, sizeof(netsnmp_transport));

- t->data = malloc(sizeof(struct sockaddr_in));
- if (t->data == NULL) {
+ addr_pair = (netsnmp_udp_addr_pair *)malloc(sizeof(netsnmp_udp_addr_pair));
+ if (addr_pair == NULL) {
netsnmp_transport_free(t);
return NULL;
}
- t->data_length = sizeof(struct sockaddr_in);
- memcpy(t->data, addr, sizeof(struct sockaddr_in));
+ t->data = addr_pair;
+ t->data_length = sizeof(netsnmp_udp_addr_pair);
+ memcpy(&(addr_pair->remote_addr), addr, sizeof(struct sockaddr_in));

t->domain = netsnmp_snmpTCPDomain;
t->domain_length =
diff -ur net-snmp-5.3.1/snmplib/snmpUDPDomain.c net-snmp-5.3.1-fixed/snmplib/snmpUDPDomain.c
--- net-snmp-5.3.1/snmplib/snmpUDPDomain.c 2005-11-05 23:01:42.000000000 +0100
+++ net-snmp-5.3.1-fixed/snmplib/snmpUDPDomain.c 2007-02-09 20:53:10.626567462 +0100
@@ -64,6 +64,11 @@

static netsnmp_tdomain udpDomain;

+typedef struct netsnmp_udp_addr_pair_s {
+ struct sockaddr_in remote_addr;
+ struct in_addr local_addr;
+} netsnmp_udp_addr_pair;
+
/*
* not static, since snmpUDPIPv6Domain needs it, but not public, either.
* (ie don't put it in a public header.)
@@ -78,17 +83,23 @@
static char *
netsnmp_udp_fmtaddr(netsnmp_transport *t, void *data, int len)
{
- struct sockaddr_in *to = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;

- if (data != NULL && len == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr_in *) data;
+ if (data != NULL && len == sizeof(netsnmp_udp_addr_pair)) {
+ addr_pair = (netsnmp_udp_addr_pair *) data;
} else if (t != NULL && t->data != NULL) {
- to = (struct sockaddr_in *) t->data;
+ addr_pair = (netsnmp_udp_addr_pair *) t->data;
}
- if (to == NULL) {
+
+ if (addr_pair == NULL) {
return strdup("UDP: unknown");
} else {
+ struct sockaddr_in *to = NULL;
char tmp[64];
+ to = (struct sockaddr_in *) &(addr_pair->remote_addr);
+ if (to == NULL) {
+ return strdup("UDP: unknown");
+ }

sprintf(tmp, "UDP: [%s]:%hu",
inet_ntoa(to->sin_addr), ntohs(to->sin_port));
@@ -98,6 +109,77 @@



+#ifdef IP_PKTINFO
+
+# define netsnmp_dstaddr(x) (&(((struct in_pktinfo *)(CMSG_DATA(x)))->ipi_addr))
+
+static int netsnmp_udp_recvfrom(int s, char *buf, int len, struct sockaddr *from, int *fromlen, struct in_addr *dstip)
+{
+ int r;
+ struct iovec iov[1];
+ char cmsg[CMSG_SPACE(sizeof(struct in_pktinfo))];
+ struct cmsghdr *cmsgptr;
+ struct msghdr msg;
+
+ iov[0].iov_base = buf;
+ iov[0].iov_len = len;
+
+ memset(&msg, 0, sizeof msg);
+ msg.msg_name = from;
+ msg.msg_namelen = *fromlen;
+ msg.msg_iov = iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control = &cmsg;
+ msg.msg_controllen = sizeof(cmsg);
+
+ r = recvmsg(s, &msg, 0);
+
+ if (r == -1) {
+ return -1;
+ }
+
+ DEBUGMSGTL(("netsnmp_udp", "got source addr: %s\n", inet_ntoa(((struct sockaddr_in *)from)->sin_addr)));
+ for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL; cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
+ if (cmsgptr->cmsg_level == SOL_IP && cmsgptr->cmsg_type == IP_PKTINFO) {
+ memcpy((void *) dstip, netsnmp_dstaddr(cmsgptr), sizeof(struct in_addr));
+ DEBUGMSGTL(("netsnmp_udp", "got destination (local) addr %s\n",
+ inet_ntoa(*dstip)));
+ }
+ }
+ return r;
+}
+
+static int netsnmp_udp_sendto(int fd, struct in_addr *srcip, struct sockaddr *remote,
+ char *data, int len)
+{
+ struct iovec iov = { data, len };
+ struct {
+ struct cmsghdr cm;
+ struct in_pktinfo ipi;
+ } cmsg = {
+ .cm = {
+ .cmsg_len = sizeof(struct cmsghdr) + sizeof(struct in_pktinfo),
+ .cmsg_level = SOL_IP,
+ .cmsg_type = IP_PKTINFO,
+ },
+ .ipi = {
+ .ipi_ifindex = 0,
+ .ipi_spec_dst = srcip ? srcip->s_addr : 0,
+ },
+ };
+ struct msghdr m = {
+ .msg_name = remote,
+ .msg_namelen = sizeof(struct sockaddr_in),
+ .msg_iov = &iov,
+ .msg_iovlen = 1,
+ .msg_control = &cmsg,
+ .msg_controllen = sizeof(cmsg),
+ .msg_flags = 0,
+ };
+ return sendmsg(fd, &m, MSG_NOSIGNAL|MSG_DONTWAIT);
+}
+#endif /* IP_PKTINFO */
+
/*
* You can write something into opaque that will subsequently get passed back
* to your send function if you like. For instance, you might want to
@@ -110,27 +192,33 @@
{
int rc = -1;
socklen_t fromlen = sizeof(struct sockaddr);
+ netsnmp_udp_addr_pair *addr_pair = NULL;
struct sockaddr *from;

if (t != NULL && t->sock >= 0) {
- from = (struct sockaddr *) malloc(sizeof(struct sockaddr_in));
- if (from == NULL) {
+ addr_pair = (netsnmp_udp_addr_pair *) malloc(sizeof(netsnmp_udp_addr_pair));
+ if (addr_pair == NULL) {
*opaque = NULL;
*olength = 0;
return -1;
} else {
- memset(from, 0, fromlen);
+ memset(addr_pair, 0, sizeof(netsnmp_udp_addr_pair));
+ from = (struct sockaddr *) &(addr_pair->remote_addr);
}

while (rc < 0) {
- rc = recvfrom(t->sock, buf, size, 0, from, &fromlen);
+#if defined IP_PKTINFO
+ rc = netsnmp_udp_recvfrom(t->sock, buf, size, from, &fromlen, &(addr_pair->local_addr));
+#else
+ rc = recvfrom(t->sock, buf, size, 0, from, &fromlen);
+#endif /* IP_PKTINFO */
if (rc < 0 && errno != EINTR) {
break;
}
}

if (rc >= 0) {
- char *str = netsnmp_udp_fmtaddr(NULL, from, fromlen);
+ char *str = netsnmp_udp_fmtaddr(NULL, addr_pair, sizeof(netsnmp_udp_addr_pair));
DEBUGMSGTL(("netsnmp_udp",
"recvfrom fd %d got %d bytes (from %s)\n",
t->sock, rc, str));
@@ -139,8 +227,8 @@
DEBUGMSGTL(("netsnmp_udp", "recvfrom fd %d err %d (\"%s\")\n",
t->sock, errno, strerror(errno)));
}
- *opaque = (void *)from;
- *olength = sizeof(struct sockaddr_in);
+ *opaque = (void *)addr_pair;
+ *olength = sizeof(netsnmp_udp_addr_pair);
}
return rc;
}
@@ -152,24 +240,31 @@
void **opaque, int *olength)
{
int rc = -1;
+ netsnmp_udp_addr_pair *addr_pair = NULL;
struct sockaddr *to = NULL;

if (opaque != NULL && *opaque != NULL &&
- *olength == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr *) (*opaque);
+ *olength == sizeof(netsnmp_udp_addr_pair)) {
+ addr_pair = (netsnmp_udp_addr_pair *) (*opaque);
} else if (t != NULL && t->data != NULL &&
- t->data_length == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr *) (t->data);
+ t->data_length == sizeof(netsnmp_udp_addr_pair)) {
+ addr_pair = (netsnmp_udp_addr_pair *) (t->data);
}

+ to = (struct sockaddr *) &(addr_pair->remote_addr);
+
if (to != NULL && t != NULL && t->sock >= 0) {
- char *str = netsnmp_udp_fmtaddr(NULL, (void *) to,
- sizeof(struct sockaddr_in));
+ char *str = netsnmp_udp_fmtaddr(NULL, (void *) addr_pair,
+ sizeof(netsnmp_udp_addr_pair));
DEBUGMSGTL(("netsnmp_udp", "send %d bytes from %p to %s on fd %d\n",
size, buf, str, t->sock));
free(str);
while (rc < 0) {
- rc = sendto(t->sock, buf, size, 0, to, sizeof(struct sockaddr));
+#if defined IP_PKTINFO
+ rc = netsnmp_udp_sendto(t->sock, addr_pair ? &(addr_pair->local_addr) : NULL, to, buf, size);
+#else
+ rc = sendto(t->sock, buf, size, 0, to, sizeof(struct sockaddr));
+#endif /* IP_PKTINFO */
if (rc < 0 && errno != EINTR) {
DEBUGMSGTL(("netsnmp_udp", "sendto error, rc %d (errno %d)\n",
rc, errno));
@@ -486,18 +581,26 @@
int rc = 0;
char *str = NULL;
char *client_socket = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;

if (addr == NULL || addr->sin_family != AF_INET) {
return NULL;
}

+ addr_pair = (struct udp_addr_pair *) malloc(sizeof(netsnmp_udp_addr_pair));
+ if (addr_pair == NULL) {
+ return NULL;
+ }
+ memset(addr_pair, 0, sizeof(netsnmp_udp_addr_pair));
+ memcpy(&(addr_pair->remote_addr), addr, sizeof(struct sockaddr_in));
+
t = (netsnmp_transport *) malloc(sizeof(netsnmp_transport));
if (t == NULL) {
return NULL;
}

- str = netsnmp_udp_fmtaddr(NULL, (void *)addr,
- sizeof(struct sockaddr_in));
+ str = netsnmp_udp_fmtaddr(NULL, (void *)addr_pair,
+ sizeof(netsnmp_udp_addr_pair));
DEBUGMSGTL(("netsnmp_udp", "open %s %s:%d\n", local ? "local" : "remote",
str,addr->sin_port));
free(str);
@@ -532,6 +635,18 @@
t->local[5] = (htons(addr->sin_port) & 0x00ff) >> 0;
t->local_length = 6;

+#ifdef IP_PKTINFO
+ {
+ int sockopt = 1;
+ int sockoptlen = sizeof(int);
+ if (setsockopt(t->sock, SOL_IP, IP_PKTINFO, &sockopt, sizeof sockopt) == -1) {
+ DEBUGMSGTL(("netsnmp_udp", "couldn't set IP_PKTINFO: %s\n",
+ strerror(errno)));
+ return NULL;
+ }
+ DEBUGMSGTL(("netsnmp_udp", "set IP_PKTINFO\n"));
+ }
+#endif
rc = bind(t->sock, (struct sockaddr *) addr,
sizeof(struct sockaddr));
if (rc != 0) {
@@ -561,7 +676,7 @@
* transport-specific data pointer for later use by netsnmp_udp_send.
*/

- t->data = malloc(sizeof(struct sockaddr_in));
+ t->data = malloc(sizeof(netsnmp_udp_addr_pair));
t->remote = malloc(6);
if (t->data == NULL || t->remote == NULL) {
netsnmp_transport_free(t);
@@ -571,8 +686,8 @@
t->remote[4] = (htons(addr->sin_port) & 0xff00) >> 8;
t->remote[5] = (htons(addr->sin_port) & 0x00ff) >> 0;
t->remote_length = 6;
- memcpy(t->data, addr, sizeof(struct sockaddr_in));
- t->data_length = sizeof(struct sockaddr_in);
+ memcpy(t->data, addr_pair, sizeof(netsnmp_udp_addr_pair));
+ t->data_length = sizeof(netsnmp_udp_addr_pair);
}

/*
@@ -993,7 +1108,8 @@
char **contextName)
{
com2SecEntry *c;
- struct sockaddr_in *from = (struct sockaddr_in *) opaque;
+ netsnmp_udp_addr_pair *addr_pair = (netsnmp_udp_addr_pair *) opaque;
+ struct sockaddr_in *from = (struct sockaddr_in *) &(addr_pair->remote_addr);
char *ztcommunity = NULL;

if (secName != NULL) {
@@ -1015,7 +1131,7 @@
* name.
*/

- if (opaque == NULL || olength != sizeof(struct sockaddr_in) ||
+ if (opaque == NULL || olength != sizeof(netsnmp_udp_addr_pair) ||
from->sin_family != AF_INET) {
DEBUGMSGTL(("netsnmp_udp_getSecName",
"no IPv4 source address in PDU?\n"));
>From owner at bugs.debian.org Wed Feb 14 12:18:21 2007

From: owner at bugs.debian.org (Debian Bug Tracking System)
Date: Wed Feb 14 12:26:54 2007
Subject: [Pkg-net-snmp-devel] Processed (with 5 errors): ucd-snmp/diskio not
included?
In-Reply-To: <20070214111514.GG26928@westend.com>
References: <20070214111514.GG26928@westend.com>
Message-ID:

Processing commands for control@bugs.debian.org:

> reopen 264938

Bug#264938: Please include ucd-snmp/diskio
'reopen' is deprecated when a bug has been closed with a version;
use 'found' or 'submitter' as appropriate instead.
Bug reopened, originator not changed.

> version 5.2.3-7

Unknown command or malformed arguments to command.

> Hello

Unknown command or malformed arguments to command.

> According to this bug report and the debian/MIBLIST file the module

Unknown command or malformed arguments to command.

> ucd-snmp/diskio should be included in snmpd but at least in the

Unknown command or malformed arguments to command.

> backports.org version it is not.

Unknown command or malformed arguments to command.

Too many unknown commands, stopping here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs database)


>From ch at debian.org Wed Feb 14 12:15:14 2007

From: ch at debian.org (Christian Hammers)
Date: Wed Feb 14 12:47:17 2007
Subject: [Pkg-net-snmp-devel] Bug#264938: ucd-snmp/diskio not included?
Message-ID: <20070214111514.GG26928@westend.com>

reopen 264938
version 5.2.3-7

Hello

According to this bug report and the debian/MIBLIST file the module
ucd-snmp/diskio should be included in snmpd but at least in the
backports.org version it is not.

I think this is due to the following command in debian/rules:
$ dpkg-architecture -qDEB_HOST_ARCH_OS
DEB_HOST_ARCH_OS is not a supported variable name at
/usr/bin/dpkg-architecture line 271.

Please check if that's really available on etch/unstable (I'm only using
backports.org) and if not, please make this a wishlist report for changing
this to DEB_BUILD_GNU_SYSTEM so that backporting the package to Sarge
works.

To verify the built snmpd use this:
# snmpd -Dmib_init -H 2>&1 | grep -i mib_init.*disk
mib_init: initializing: disk
mib_init: initializing: hr_disk
^^^ "diskio" is missing ^^^

bye,

-christian-



>From max at tcen.ru Wed Feb 21 14:01:51 2007

From: max at tcen.ru (Max Kosmach)
Date: Wed Feb 21 18:32:51 2007
Subject: [Pkg-net-snmp-devel] Bug#411858: libsnmp-perl: Please apply patch
1364650 for bug 1176130
Message-ID: <20070221130151.2467.68690.reportbug@bob.tcen.ru>

Package: libsnmp-perl
Version: 5.2.3-7
Severity: normal
Tags: patch

Please apply patch 1364650 for bug 1176130
This patch really neeeded to work with many devices via libsnmp-perl
For example it needed for libsnmp-info-perl and netdisco

This patch included upstream in 5.2.4pre1 pre-release

PS. Links below
http://sourceforge.net/tracker/index...94&atid=312694
http://sourceforge.net/tracker/index...94&atid=112694

-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (990, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.4.26
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages libsnmp-perl depends on:
ii libsnmp9 5.2.3-7 NET SNMP (Simple Network Managemen
ii perl 5.8.8-7 Larry Wall's Practical Extraction
ii perl-base [perlapi-5.8.8] 5.8.8-7 The Pathologically Eclectic Rubbis

libsnmp-perl recommends no packages.

-- no debconf information


>From adm at insysnet.ru Sun Feb 25 18:26:40 2007

From: adm at insysnet.ru (Alexander Prokoshev)
Date: Mon Feb 26 16:26:22 2007
Subject: [Pkg-net-snmp-devel] Bug#344979: /usr/sbin/snmpd: snmpd segfaults
after getting trap from smux peer on amd64
Message-ID: <20070225172640.15953.25188.reportbug@gigarouter.in sysnet.ru>

Package: snmpd
Version: 5.2.3-7
Followup-For: Bug #344979

snmpd immediately gets SIGSEGV after receiving message from SMUX peer
(namely, bgpd of Quagga suite).

I've attached core file (gdb says about it following:
Program terminated with signal 11, Segmentation fault.
#0 0x00002ad923147c4a in asn_parse_objid () from /usr/lib/libnetsnmp.so.9
).
ltrace of snmpd process when sending trap to it follows:

== begin ltrace output ==
select(21, [3 5 8 12 13 14 15 16 17 18 19 20], [], [], {22, 116000}) = 1 (in [20], left {16,
516000})
recvfrom(20, "\244\202S~+\6\1\4\1\231u\1\2\2@\4\0\0\0\0\2\1\6\2\ 1\2C\1\0000\202S_0\202\0\26\6
\20+\6\1\2\1\17\3\1\16W\201b\201#\201\r\4\2\0\0\0\ 0\0\0\6\20+\6\1\2\1\17\3\1\2W\201b\201#\201
\r\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

=== message truncated ===-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/...______________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders



---------------------------------
Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.
--0-937911753-1182975217=:85207
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

I think the way the structures are being initialized looks odd to me ....


Here is the original routine code:


static int netsnmp_udp_sendto(int fd, struct in_addr *srcip, struct sockaddr *remote,
            char *data, int len)
{
    struct iovec iov = { data, len };
    struct {
        struct cmsghdr cm;
        struct in_pktinfo ipi;
    } cmsg = {
        .cm = {
            .cmsg_len    = sizeof(struct cmsghdr) + sizeof(struct in_pktinfo),
            .cmsg_level    =
SOL_IP,
            .cmsg_type    = IP_PKTINFO,
        },
        .ipi = {
            .ipi_ifindex    = 0,
            .ipi_spec_dst    = srcip ? srcip->s_addr : 0,
        },
    };
    struct msghdr m = {
        .msg_name    = remote,
        .msg_namelen    = sizeof(struct sockaddr_in),
        .msg_iov    = &iov,
        .msg_iovlen    = 1,
       
.msg_control    = &cmsg,
        .msg_controllen    = sizeof(cmsg),
        .msg_flags    = 0,
    };
    return sendmsg(fd, &m, MSG_NOSIGNAL|MSG_DONTWAIT);
}







Need Help <snmpnoob@yahoo.com> wrote:
I am trying to compile NetSNMP 5.4 into my build environment using our "mipsel-uclibc-g++" compiler, however, compiler errors are being generated in the "snmpUDPDomain.c" file.

I searched for this error on the internet and found that the code was inserted as part of a patch I think.  Please see the email attached to this post for the description of the code inserted.   Perhaps I am the first one trying to compile this code with the
g++ compiler? 

If someone could indicate how I should fix this error, I would be much appreciated.

Here is the compiler error generated: 
(*** Note: I also attached the "snmpUDPDomain.c" file for reference)


/bin/sh ../libtool  --mode=compile mipsel-uclibc-g++ -I../include -I/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/include -I.      -I../snmplib -I/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/snmplib  -g -O2 -Ulocalhost -Dlocalhost=localhost  -c -o snmpUDPDomain.lo snmpUDPDomain.c
 mipsel-uclibc-g++ -I../include -I/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/include -I. -I../snmplib -I/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/snmplib -g -O2 -Ulocalhost -Dlocalhost=localhost -c snmpUDPDomain.c -o snmpUDPDomain.o
snmpUDPDomain.c: In function `int netsnmp_udp_sendto(int,
in_addr*, sockaddr*,
   char*, int)':
snmpUDPDomain.c:163: error: parse error before `.' token
snmpUDPDomain.c:168: error: parse error before `.' token
snmpUDPDomain.c: At global scope:
snmpUDPDomain.c:174: error: parse error before `.' token
snmpUDPDomain.c:182: error: parse error before `return'
snmpUDPDomain.c: In function `int netsnmp_udp_recv(netsnmp_transport*, void*,
   int, void**, int*)':
snmpUDPDomain.c:214: error: invalid conversion from `void*' to `char*'
snmpUDPDomain.c: In function `int netsnmp_udp_send(netsnmp_transport*, void*,
   int, void**, int*)':
snmpUDPDomain.c:267: error: invalid conversion from `void*' to `char*'
make[2]: *** [snmpUDPDomain.lo] Error 1
make[2]: Leaving directory `/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp/snmplib'
make[1]: *** [subdirs] Error 1
make[1]: Leaving directory `/export/home/myname/vegasCC/1.97/buildsys/A506/netsnmp'
make: ***
[net-snmp-make] Error 2




Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out. >From jandres at gmx.net Fri Feb 9 22:15:06 2007
From: jandres at gmx.net (Jan Andres)
Date: Sat Feb 10 12:48:31 2007
Subject: [Pkg-net-snmp-devel] [Patch] net-snmp 5.3.1-2: 24_pktinfo.patch
breaks TCP
Message-ID: <20070209211506.GA6381@pitr.home.jan>

Hi,

With 24_pktinfo.patch applied snmpd will never respond to TCP
requests, because the address -> security name mapping always fails.

I propose the patch attached as a replacement for 24_pktinfo.patch. It's
the version of the fix as diffed from the V5-3-patches branch
of net-snmp,
and includes the fix for the TCP code.

Regards,
Jan

--
Jan Andres
-------------- next part --------------
diff -ur net-snmp-5.3.1/snmplib/snmpTCPDomain.c net-snmp-5.3.1-fixed/snmplib/snmpTCPDomain.c
--- net-snmp-5.3.1/snmplib/snmpTCPDomain.c 2005-09-16 12:30:48.000000000 +0200
+++ net-snmp-5.3.1-fixed/snmplib/snmpTCPDomain.c 2007-02-09 20:52:29.112680146 +0100
@@ -44,6 +44,12 @@
#include
#include

+/* Copied from snmpUDPDomain.c */
+typedef struct netsnmp_udp_addr_pair_s {
+ struct sockaddr_in remote_addr;
+ struct in_addr local_addr;
+} netsnmp_udp_addr_pair;
+
oid netsnmp_snmpTCPDomain[] = { TRANSPORT_DOMAIN_TCP_IP };
static netsnmp_tdomain tcpDomain;

@@ -55,18 +61,23 @@
static char *
netsnmp_tcp_fmtaddr(netsnmp_transport *t, void *data, int len)
{
-
struct sockaddr_in *to = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;

- if (data != NULL && len == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr_in *) data;
- } else if (t != NULL && t->data != NULL &&
- t->data_length == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr_in *) t->data;
+ if (data != NULL && len == sizeof(netsnmp_udp_addr_pair)) {
+ addr_pair = (netsnmp_udp_addr_pair *) data;
+ } else if (t != NULL && t->data != NULL) {
+ addr_pair = (netsnmp_udp_addr_pair *) t->data;
}
- if (to == NULL) {
+
+ if (addr_pair == NULL) {
return strdup("TCP: unknown");
} else {
- char tmp[64];
+ struct sockaddr_in *to = NULL;
+ char tmp[64];
+ to = (struct sockaddr_in *) &(addr_pair->remote_addr);
+ if (to == NULL) {
+ return
strdup("TCP: unknown");
+ }

sprintf(tmp, "TCP: [%s]:%hd",
inet_ntoa(to->sin_addr), ntohs(to->sin_port));
@@ -163,19 +174,21 @@
netsnmp_tcp_accept(netsnmp_transport *t)
{
struct sockaddr *farend = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;
int newsock = -1, sockflags = 0;
socklen_t farendlen = sizeof(struct sockaddr_in);
char *str = NULL;

- farend = (struct sockaddr *) malloc(sizeof(struct sockaddr_in));
+ addr_pair = (netsnmp_udp_addr_pair *)malloc(sizeof(netsnmp_udp_addr_pair));

- if (farend == NULL) {
+ if (addr_pair == NULL) {
/*
* Indicate that the acceptance of this socket failed.
*/
DEBUGMSGTL(("netsnmp_tcp", "accept: malloc failed\n"));
return -1;
}
+ farend = (struct sockaddr_in *) &(addr_pair->remote_addr);


if (t != NULL && t->sock >= 0) {
newsock = accept(t->sock, farend, &farendlen);
@@ -191,8 +204,8 @@
free(t->data);
}

- t->data = farend;
- t->data_length = farendlen;
+ t->data = addr_pair;
+ t->data_length = sizeof(netsnmp_udp_addr_pair);
str = netsnmp_tcp_fmtaddr(NULL, farend, farendlen);
DEBUGMSGTL(("netsnmp_tcp", "accept succeeded (from %s)\n", str));
free(str);
@@ -238,6 +251,7 @@
netsnmp_tcp_transport(struct sockaddr_in *addr, int local)
{
netsnmp_transport *t = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;
int rc = 0;


@@ -251,13 +265,14 @@
}
memset(t, 0, sizeof(netsnmp_transport));

- t->data = malloc(sizeof(struct sockaddr_in));
- if (t->data == NULL) {
+ addr_pair = (netsnmp_udp_addr_pair
*)malloc(sizeof(netsnmp_udp_addr_pair));
+ if (addr_pair == NULL) {
netsnmp_transport_free(t);
return NULL;
}
- t->data_length = sizeof(struct sockaddr_in);
- memcpy(t->data, addr, sizeof(struct sockaddr_in));
+ t->data = addr_pair;
+ t->data_length = sizeof(netsnmp_udp_addr_pair);
+ memcpy(&(addr_pair->remote_addr), addr, sizeof(struct sockaddr_in));

t->domain = netsnmp_snmpTCPDomain;
t->domain_length =
diff -ur net-snmp-5.3.1/snmplib/snmpUDPDomain.c net-snmp-5.3.1-fixed/snmplib/snmpUDPDomain.c
--- net-snmp-5.3.1/snmplib/snmpUDPDomain.c 2005-11-05 23:01:42.000000000 +0100
+++ net-snmp-5.3.1-fixed/snmplib/snmpUDPDomain.c 2007-02-09 20:53:10.626567462 +0100
@@ -64,6 +64,11 @@

static netsnmp_tdomain udpDomain;

+typedef struct netsnmp_udp_addr_pair_s {
+ struct sockaddr_in remote_addr;
+ struct in_addr local_addr;
+}
netsnmp_udp_addr_pair;
+
/*
* not static, since snmpUDPIPv6Domain needs it, but not public, either.
* (ie don't put it in a public header.)
@@ -78,17 +83,23 @@
static char *
netsnmp_udp_fmtaddr(netsnmp_transport *t, void *data, int len)
{
- struct sockaddr_in *to = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;

- if (data != NULL && len == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr_in *) data;
+ if (data != NULL && len == sizeof(netsnmp_udp_addr_pair)) {
+ addr_pair = (netsnmp_udp_addr_pair *) data;
} else if (t != NULL && t->data != NULL) {
- to = (struct sockaddr_in *) t->data;
+ addr_pair = (netsnmp_udp_addr_pair *) t->data;
}
- if (to == NULL) {
+
+ if (addr_pair == NULL) {
return strdup("UDP: unknown");
} else {
+ struct sockaddr_in *to = NULL;
char tmp[64];
+ to
= (struct sockaddr_in *) &(addr_pair->remote_addr);
+ if (to == NULL) {
+ return strdup("UDP: unknown");
+ }

sprintf(tmp, "UDP: [%s]:%hu",
inet_ntoa(to->sin_addr), ntohs(to->sin_port));
@@ -98,6 +109,77 @@



+#ifdef IP_PKTINFO
+
+# define netsnmp_dstaddr(x) (&(((struct in_pktinfo *)(CMSG_DATA(x)))->ipi_addr))
+
+static int netsnmp_udp_recvfrom(int s, char *buf, int len, struct sockaddr *from, int *fromlen, struct in_addr *dstip)
+{
+ int r;
+ struct iovec iov[1];
+ char cmsg[CMSG_SPACE(sizeof(struct in_pktinfo))];
+ struct cmsghdr *cmsgptr;
+ struct msghdr msg;
+
+ iov[0].iov_base = buf;
+ iov[0].iov_len = len;
+
+ memset(&msg, 0, sizeof msg);
+ msg.msg_name = from;
+ msg.msg_namelen = *fromlen;
+ msg.msg_iov = iov;
+ msg.msg_iovlen = 1;
+ msg.msg_control =
&cmsg;
+ msg.msg_controllen = sizeof(cmsg);
+
+ r = recvmsg(s, &msg, 0);
+
+ if (r == -1) {
+ return -1;
+ }
+
+ DEBUGMSGTL(("netsnmp_udp", "got source addr: %s\n", inet_ntoa(((struct sockaddr_in *)from)->sin_addr)));
+ for (cmsgptr = CMSG_FIRSTHDR(&msg); cmsgptr != NULL; cmsgptr = CMSG_NXTHDR(&msg, cmsgptr)) {
+ if (cmsgptr->cmsg_level == SOL_IP && cmsgptr->cmsg_type == IP_PKTINFO) {
+ memcpy((void *) dstip, netsnmp_dstaddr(cmsgptr), sizeof(struct in_addr));
+ DEBUGMSGTL(("netsnmp_udp", "got destination (local) addr %s\n",
+ inet_ntoa(*dstip)));
+ }
+ }
+ return r;
+}
+
+static int netsnmp_udp_sendto(int fd, struct in_addr *srcip, struct sockaddr *remote,
+ char *data, int len)
+{
+ struct iovec iov = { data, len };
+ struct {
+ struct cmsghdr cm;
+
struct in_pktinfo ipi;
+ } cmsg = {
+ .cm = {
+ .cmsg_len = sizeof(struct cmsghdr) + sizeof(struct in_pktinfo),
+ .cmsg_level = SOL_IP,
+ .cmsg_type = IP_PKTINFO,
+ },
+ .ipi = {
+ .ipi_ifindex = 0,
+ .ipi_spec_dst = srcip ? srcip->s_addr : 0,
+ },
+ };
+ struct msghdr m = {
+ .msg_name = remote,
+ .msg_namelen = sizeof(struct sockaddr_in),
+ .msg_iov = &iov,
+ .msg_iovlen = 1,
+ .msg_control = &cmsg,
+ .msg_controllen = sizeof(cmsg),
+ .msg_flags = 0,
+ };
+ return sendmsg(fd, &m, MSG_NOSIGNAL|MSG_DONTWAIT);
+}
+#endif /* IP_PKTINFO */
+
/*
* You can write something into opaque that will subsequently get passed back
* to your send function if you like. For instance, you might want to
@@ -110,27 +192,33 @@
{
int
rc = -1;
socklen_t fromlen = sizeof(struct sockaddr);
+ netsnmp_udp_addr_pair *addr_pair = NULL;
struct sockaddr *from;

if (t != NULL && t->sock >= 0) {
- from = (struct sockaddr *) malloc(sizeof(struct sockaddr_in));
- if (from == NULL) {
+ addr_pair = (netsnmp_udp_addr_pair *) malloc(sizeof(netsnmp_udp_addr_pair));
+ if (addr_pair == NULL) {
*opaque = NULL;
*olength = 0;
return -1;
} else {
- memset(from, 0, fromlen);
+ memset(addr_pair, 0, sizeof(netsnmp_udp_addr_pair));
+ from = (struct sockaddr *) &(addr_pair->remote_addr);
}

while (rc < 0) {
- rc = recvfrom(t->sock, buf, size, 0, from, &fromlen);
+#if defined IP_PKTINFO
+ rc = netsnmp_udp_recvfrom(t->sock, buf, size, from, &fromlen,
&(addr_pair->local_addr));
+#else
+ rc = recvfrom(t->sock, buf, size, 0, from, &fromlen);
+#endif /* IP_PKTINFO */
if (rc < 0 && errno != EINTR) {
break;
}
}

if (rc >= 0) {
- char *str = netsnmp_udp_fmtaddr(NULL, from, fromlen);
+ char *str = netsnmp_udp_fmtaddr(NULL, addr_pair, sizeof(netsnmp_udp_addr_pair));
DEBUGMSGTL(("netsnmp_udp",
"recvfrom fd %d got %d bytes (from %s)\n",
t->sock, rc, str));
@@ -139,8 +227,8 @@
DEBUGMSGTL(("netsnmp_udp", "recvfrom fd %d err %d (\"%s\")\n",
t->sock, errno, strerror(errno)));
}
- *opaque = (void *)from;
- *olength = sizeof(struct sockaddr_in);
+ *opaque = (void *)addr_pair;
+ *olength = sizeof(netsnmp_udp_addr_pair);
}
return rc;
}
@@ -152,24 +240,31 @@

void **opaque, int *olength)
{
int rc = -1;
+ netsnmp_udp_addr_pair *addr_pair = NULL;
struct sockaddr *to = NULL;

if (opaque != NULL && *opaque != NULL &&
- *olength == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr *) (*opaque);
+ *olength == sizeof(netsnmp_udp_addr_pair)) {
+ addr_pair = (netsnmp_udp_addr_pair *) (*opaque);
} else if (t != NULL && t->data != NULL &&
- t->data_length == sizeof(struct sockaddr_in)) {
- to = (struct sockaddr *) (t->data);
+ t->data_length == sizeof(netsnmp_udp_addr_pair)) {
+ addr_pair = (netsnmp_udp_addr_pair *) (t->data);
}

+ to = (struct sockaddr *) &(addr_pair->remote_addr);
+
if (to != NULL && t != NULL && t->sock >= 0) {
- char *str = netsnmp_udp_fmtaddr(NULL, (void *)
to,
- sizeof(struct sockaddr_in));
+ char *str = netsnmp_udp_fmtaddr(NULL, (void *) addr_pair,
+ sizeof(netsnmp_udp_addr_pair));
DEBUGMSGTL(("netsnmp_udp", "send %d bytes from %p to %s on fd %d\n",
size, buf, str, t->sock));
free(str);
while (rc < 0) {
- rc = sendto(t->sock, buf, size, 0, to, sizeof(struct sockaddr));
+#if defined IP_PKTINFO
+ rc = netsnmp_udp_sendto(t->sock, addr_pair ? &(addr_pair->local_addr) : NULL, to, buf, size);
+#else
+ rc = sendto(t->sock, buf, size, 0, to, sizeof(struct sockaddr));
+#endif /* IP_PKTINFO */
if (rc < 0 && errno != EINTR) {
DEBUGMSGTL(("netsnmp_udp", "sendto error, rc %d (errno %d)\n",
rc, errno));
@@ -486,18 +581,26 @@
int rc = 0;
char *str =
NULL;
char *client_socket = NULL;
+ netsnmp_udp_addr_pair *addr_pair = NULL;

if (addr == NULL || addr->sin_family != AF_INET) {
return NULL;
}

+ addr_pair = (struct udp_addr_pair *) malloc(sizeof(netsnmp_udp_addr_pair));
+ if (addr_pair == NULL) {
+ return NULL;
+ }
+ memset(addr_pair, 0, sizeof(netsnmp_udp_addr_pair));
+ memcpy(&(addr_pair->remote_addr), addr, sizeof(struct sockaddr_in));
+
t = (netsnmp_transport *) malloc(sizeof(netsnmp_transport));
if (t == NULL) {
return NULL;
}

- str = netsnmp_udp_fmtaddr(NULL, (void *)addr,
- sizeof(struct sockaddr_in));
+ str = netsnmp_udp_fmtaddr(NULL, (void *)addr_pair,
+ sizeof(netsnmp_udp_addr_pair));
DEBUGMSGTL(("netsnmp_udp", "open %s %s:%d\n", local ? "local" : "remote",

str,addr->sin_port));
free(str);
@@ -532,6 +635,18 @@
t->local[5] = (htons(addr->sin_port) & 0x00ff) >> 0;
t->local_length = 6;

+#ifdef IP_PKTINFO
+ {
+ int sockopt = 1;
+ int sockoptlen = sizeof(int);
+ if (setsockopt(t->sock, SOL_IP, IP_PKTINFO, &sockopt, sizeof sockopt) == -1) {
+ DEBUGMSGTL(("netsnmp_udp", "couldn't set IP_PKTINFO: %s\n",
+ strerror(errno)));
+ return NULL;
+ }
+ DEBUGMSGTL(("netsnmp_udp", "set IP_PKTINFO\n"));
+ }
+#endif
rc = bind(t->sock, (struct sockaddr *) addr,
sizeof(struct sockaddr));
if (rc != 0) {
@@ -561,7 +676,7 @@
* transport-specific data pointer for later use by netsnmp_udp_send.
*/

- t->data = malloc(sizeof(struct
sockaddr_in));
+ t->data = malloc(sizeof(netsnmp_udp_addr_pair));
t->remote = malloc(6);
if (t->data == NULL || t->remote == NULL) {
netsnmp_transport_free(t);
@@ -571,8 +686,8 @@
t->remote[4] = (htons(addr->sin_port) & 0xff00) >> 8;
t->remote[5] = (htons(addr->sin_port) & 0x00ff) >> 0;
t->remote_length = 6;
- memcpy(t->data, addr, sizeof(struct sockaddr_in));
- t->data_length = sizeof(struct sockaddr_in);
+ memcpy(t->data, addr_pair, sizeof(netsnmp_udp_addr_pair));
+ t->data_length = sizeof(netsnmp_udp_addr_pair);
}

/*
@@ -993,7 +1108,8 @@
char **contextName)
{
com2SecEntry *c;
- struct sockaddr_in *from = (struct sockaddr_in *) opaque;
+ netsnmp_udp_addr_pair *addr_pair = (netsnmp_udp_addr_pair *) opaque;
+
struct sockaddr_in *from = (struct sockaddr_in *) &(addr_pair->remote_addr);
char *ztcommunity = NULL;

if (secName != NULL) {
@@ -1015,7 +1131,7 @@
* name.
*/

- if (opaque == NULL || olength != sizeof(struct sockaddr_in) ||
+ if (opaque == NULL || olength != sizeof(netsnmp_udp_addr_pair) ||
from->sin_family != AF_INET) {
DEBUGMSGTL(("netsnmp_udp_getSecName",
"no IPv4 source address in PDU?\n"));
>From owner at bugs.debian.org Wed Feb 14 12:18:21 2007
From: owner at bugs.debian.org (Debian Bug Tracking System)
Date: Wed Feb 14 12:26:54 2007
Subject: [Pkg-net-snmp-devel] Processed (with 5 errors): ucd-snmp/diskio not
included?
In-Reply-To: <20070214111514.GG26928@westend.com>
References: <20070214111514.GG26928@westend.com>
Message-ID:

Processing commands
for control@bugs.debian.org:

> reopen 264938
Bug#264938: Please include ucd-snmp/diskio
'reopen' is deprecated when a bug has been closed with a version;
use 'found' or 'submitter' as appropriate instead.
Bug reopened, originator not changed.

> version 5.2.3-7
Unknown command or malformed arguments to command.

> Hello
Unknown command or malformed arguments to command.

> According to this bug report and the debian/MIBLIST file the module
Unknown command or malformed arguments to command.

> ucd-snmp/diskio should be included in snmpd but at least in the
Unknown command or malformed arguments to command.

> backports.org version it is not.
Unknown command or malformed arguments to command.

Too many unknown commands, stopping here.

Please contact me if you need assistance.

Debian bug tracking system administrator
(administrator, Debian Bugs
database)


>From ch at debian.org Wed Feb 14 12:15:14 2007
From: ch at debian.org (Christian Hammers)
Date: Wed Feb 14 12:47:17 2007
Subject: [Pkg-net-snmp-devel] Bug#264938: ucd-snmp/diskio not included?
Message-ID: <20070214111514.GG26928@westend.com>

reopen 264938
version 5.2.3-7

Hello

According to this bug report and the debian/MIBLIST file the module
ucd-snmp/diskio should be included in snmpd but at least in the
backports.org version it is not.

I think this is due to the following command in debian/rules:
$ dpkg-architecture -qDEB_HOST_ARCH_OS
DEB_HOST_ARCH_OS is not a supported variable name at
/usr/bin/dpkg-architecture line 271.

Please check if that's really available on etch/unstable (I'm only using
backports.org) and if not, please make this a wishlist report for changing
this to DEB_BUILD_GNU_SYSTEM so that backporting the package to Sarge
works.

To verify
the built snmpd use this:
# snmpd -Dmib_init -H 2>&1 | grep -i mib_init.*disk
mib_init: initializing: disk
mib_init: initializing: hr_disk
^^^ "diskio" is missing ^^^

bye,

-christian-



>From max at tcen.ru Wed Feb 21 14:01:51 2007
From: max at tcen.ru (Max Kosmach)
Date: Wed Feb 21 18:32:51 2007
Subject: [Pkg-net-snmp-devel] Bug#411858: libsnmp-perl: Please apply patch
1364650 for bug 1176130
Message-ID: <20070221130151.2467.68690.reportbug@bob.tcen.ru >

Package: libsnmp-perl
Version: 5.2.3-7
Severity: normal
Tags: patch

Please apply patch 1364650 for bug 1176130
This patch really neeeded to work with many devices via libsnmp-perl
For example it needed for libsnmp-info-perl and netdisco

This patch included upstream in 5.2.4pre1 pre-release

PS. Links
below
http://sourceforge.net/tracker/index.php?func=detail&aid=1364650&group_id=12694&a tid=312694
http://sourceforge.net/tracker/index.php?func=detail&aid=1176130&group_id=12694&a tid=112694

-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (990, 'unstable')
Architecture: i386 (i686)
Shell: /bin/sh linked to /bin/bash
Kernel: Linux 2.4.26
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)

Versions of packages libsnmp-perl depends on:
ii libsnmp9 5.2.3-7 NET SNMP (Simple Network Managemen
ii perl 5.8.8-7 Larry Wall's Practical Extraction
ii perl-base [perlapi-5.8.8] 5.8.8-7 The Pathologically Eclectic Rubbis

libsnmp-perl recommends no packages.

-- no debconf information


>From adm at insysnet.ru Sun Feb 25 18:26:40 2007
From: adm at insysnet.ru
(Alexander Prokoshev)
Date: Mon Feb 26 16:26:22 2007
Subject: [Pkg-net-snmp-devel] Bug#344979: /usr/sbin/snmpd: snmpd segfaults
after getting trap from smux peer on amd64
Message-ID: <20070225172640.15953.25188.reportbug@gigarouter.i nsysnet.ru>

Package: snmpd
Version: 5.2.3-7
Followup-For: Bug #344979

snmpd immediately gets SIGSEGV after receiving message from SMUX peer
(namely, bgpd of Quagga suite).

I've attached core file (gdb says about it following:
Program terminated with signal 11, Segmentation fault.
#0 0x00002ad923147c4a in asn_parse_objid () from /usr/lib/libnetsnmp.so.9
).
ltrace of snmpd process when sending trap to it follows:

== begin ltrace output ==
select(21, [3 5 8 12 13 14 15 16 17
18 19 20], [], [], {22, 116000}) = 1 (in [20], left {16,
516000})
recvfrom(20, "\244\202S~+\6\1\4\1\231u\1\2\2@\4\0\0\0\0\2\1\6\2\ 1\2C\1\0000\202S_0\202\0\26\6
\20+\6\1\2\1\17\3\1\16W\201b\201#\201\r\4\2\0\0\0\ 0\0\0\6\20+\6\1\2\1\17\3\1\2W\201b\201#\201
\r\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\
0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\ 0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0

=== message truncated ===-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No
limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders



Be a better Globetrotter. Get better travel answers from someone who knows.
Yahoo! Answers - Check it out.


--0-937911753-1182975217=:85207--


--===============0639013139==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--===============0639013139==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--===============0639013139==--