Dear all,
We have found net-snmp 5.4 behaves differently to 5.3.1 with regard to snmp
requests sent to a broadcast IP address. Eg. 192.168.1.255. We are running
linux.
5.3.1 responds no problem; 5.4 sees the request but is unable to send a
response.
This is because in 5.4 in snmplib/snmpUDPDomain.c it tries hard to send back
the request on the local address it was received on.
In this case it is the broadcast address to which the OS returns EINVAL on the
sendmsg call.
The workaround is simply instead of using netsnmp_udp_sendto to send the
packet, which attempts to specify which local address should be used to send
from,
to use 'sendto'. This restores the behaviour of 5.3.1
i.e.
#if defined(linux) && 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 /* linux && IP_PKTINFO */
Becomes
#if 0
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 /* linux && IP_PKTINFO */
We want to know why to not support this requirement always.
Is this function going to be provided later? And when ?
Would you please give me answer?
Thanks & Regards
Steven.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders