Den 31-03-2014 08:34, Niels Baggesen skrev: > On Fri, Mar 28, 2014 at 02:02:08PM +0100, Joel Hansell wrote: >> No luck there either, I'm afraid. Same old depressing output after >> replacing that line and re-compiling. >> (Used host name in the snmpTrapdAddr directive, this time, same result as >> with ip address.) > > It was ua bit of a long shot :-) It might even be that it does not take > that code path ...
OK, according to the config it should take that path .... Here is an extended patch, with some more debug. Could you try that? diff --git a/snmplib/transports/snmpUDPBaseDomain.c b/snmplib/transports/snmpUDPBaseDomain.c index 58b6fde..8618423 100644 --- a/snmplib/transports/snmpUDPBaseDomain.c +++ b/snmplib/transports/snmpUDPBaseDomain.c @@ -386,7 +386,7 @@ netsnmp_udpbase_recv(netsnmp_transport *t, void *buf, int size, void **opaque, int *olength) { int rc = -1; - socklen_t fromlen = sizeof(struct sockaddr); + socklen_t fromlen = sizeof(netsnmp_sockaddr_storage); netsnmp_indexed_addr_pair *addr_pair = NULL; struct sockaddr *from; @@ -409,6 +409,12 @@ netsnmp_udpbase_recv(netsnmp_transport *t, void *buf, int size, &local_addr_len, &(addr_pair->if_index)); #else rc = recvfrom(t->sock, buf, size, MSG_DONTWAIT, from, &fromlen); + DEBUGMSGTL(("netsnmp_udp", "fromlen=%d->%d, af=%d\n", + sizeof(netsnmp_sockaddr_storage), + fromlen, from->sa_family)); + DEBUGMSGTL(("netsnmp_udp", "port=%hu, addr=%08lx\n", + ntohs(((struct sockaddr_in *)from)->sin_port), + (long)((struct sockaddr_in *)from)->sin_addr.s_addr)); #endif /* netsnmp_udpbase_recvfrom_sendto_defined */ if (rc < 0 && errno != EINTR) { break; (even if the patchis f***ed up in the mail, it should be simple enough to do by hand :-) /Niels -- Niels Baggesen - @home - Ã…rhus - Denmark - n...@users.sourceforge.net The purpose of computing is insight, not numbers --- R W Hamming ------------------------------------------------------------------------------ _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders