Menu

#2336 snmpd no longer responds to broadcast UDP packets (v5.2.5.1)

linux
closed
nobody
library (262)
5
2014-09-18
2012-02-16
No

Sending a broadcast UDP snmp message to a device running snmpd 5.2.5.1 will fail:

client:
$ snmpget -v 2c -c public 255.255.255.255 iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0

server:
$ tail -f snmpd.log
Turning on AgentX master support.
NET-SNMP version 5.2.5.1
send response: Failure in sendto
-- .1.3.6.1.2.1.1.2.0

I did a git bisect and narrowed it down to this commit:
09ee3c4 2006-09-14 22:13:07 +0000 Wes Hardaker: NEWS: snmplib: PATCH: 1553447: responses will get sent from the original dest IP address

The feature worked until then. It does not seem to me that this was on purpose. Has this been fixed in a newer version?

Discussion

  • David Dombrowsky

    revert commit that disabled broadcast SNMP

     
  • David Dombrowsky

    To fix this in v5.2.5, I reverted the offending commit. I'd be willing to look into this further if I knew I was on the right track. That is: that the original intent of 09ee3c4 wasn't to disable SNMP broadcast responses.

     
  • Bart Van Assche

    Bart Van Assche - 2012-02-23

    The first step is to find out yourself whether this works with one of the still maintained versions (5.4, 5.5, 5.6 or 5.7).

     
  • David Dombrowsky

    It looks like this commit fixes it:

    948f129132b2389c56b9c444f80032245dc2f6c5

    Author: Jan Safranek jsafranek@users.sourceforge.net 2009-12-01 02:34:43
    Committer: Jan Safranek jsafranek@users.sourceforge.net 2009-12-01 02:34:43
    Parent: 7aa870ff83af082ed83e9441f5ad6f6c29ae16bb (Make it possible to actually compile after 17852.)
    Branches: master, remotes/origin/master, remotes/upstream/V5-7-branches, remotes/upstream/V5-7-patches, remotes/upstream/master, remotes/upstream/windows-mib-implementations
    Follows: v5.5
    Precedes: v5.6.pre1

    CHANGES: snmplib: Fix responding to broadcast requests.
    UDP responses are sent with source IP address which was destination of
    appropriate requests \(implemented in SVN rev. 15215\). But if the destination
    of a request is broadcast IP address, the request was sent with the broadcast
    address as source. sendmsg\(\) on Linux does not support this and returns error
    -> response is not sent. In order to send responses from the same interface,
    interface index of the appropriate interface must be used.
    

    Let me confirm this in > 5.6

     
  • David Dombrowsky

    Thanks for the bug report!
    We've fixed the problem in the 5.6.x and 5.7.x code branches and the main development tree, so it should be fixed in future releases of the Net-SNMP package.

     
  • David Dombrowsky

    confirmed fixed in 5.6.1

    sorry for the false alarm.

     
  • RS.

    RS. - 2014-09-18

    It doesn't seem to be fixed. I'm using net-snmp 5.7.2.1. I still get "Failure in sendto". If I turn on the SNMP_FLAGS_UDP_BROADCAST flag in snmp_api.c (https://sourceforge.net/p/net-snmp/bugs/2334/), I get "Timeout". Am I missing something?

    Thanks,
    RS

     
  • Bill Fenner

    Bill Fenner - 2014-09-18

    RS,

    This bug is about an agent responding to broadcast requests. Your question seems to be about sending broadcast requests.

     
  • RS.

    RS. - 2014-09-18

    Oops! read the question wrong!
    But could you answer my question?!

     

Log in to post a comment.