Bug 825889 - snmpd transmits reply UDP packets on incorrect interface
Summary: snmpd transmits reply UDP packets on incorrect interface
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-snmp
Version: 6.2
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Jan Safranek
QA Contact: Dalibor Pospíšil
Depends On:
TreeView+ depends on / blocked
Reported: 2012-05-29 00:56 UTC by Benjamin LaHaise
Modified: 2013-11-21 20:02 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously, the snmpd daemon was updated to send SNMP responses to broadcast requests from the same interface on which the SNMP was received. However, this update also introduced an error which prevented it from sending responses to unicast request on multihomed machines (that is, on machines with multiple network interfaces, each facing a different network). This update corrects this error so that the snmpd daemon is now able to both answer unicast requests on multihomed machines and send responses to broadcast requests from the same interface on which the request was received.
Clone Of:
Last Closed: 2013-02-21 10:27:11 UTC
Target Upstream Version:

Attachments (Terms of Use)
patch for snmpd (493 bytes, patch)
2012-05-29 00:56 UTC, Benjamin LaHaise
no flags Details | Diff
patch from RHEL 5 (890 bytes, patch)
2012-07-26 12:06 UTC, Michal Žejdl
no flags Details | Diff

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0421 normal SHIPPED_LIVE net-snmp bug fix and enhancement update 2013-02-20 20:49:35 UTC

Description Benjamin LaHaise 2012-05-29 00:56:47 UTC
Created attachment 587291 [details]
patch for snmpd

Description of problem:

snmpd transmits reply UDP packets on incorrect interface on routers with multiple subnets.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Turn off rp_filter in the kernel.

2. Configure a host with 2 ethernet interfaces on different subnets (subnet A.A.A.0 and B.B.B.0 with a default route to a host on A.A.A.something).

3. Send an snmp query from a device C.C.C.C such that it is received by the device (not on subnet A.A.A.0 or B.B.B.0, but reachable via the default route on A.A.A.something) under test on the B.B.B.0 subnet, but where the response must be sent to C.C.C.C via the default route on the A.A.A.0 subnet.

4. Observe that packets to C.C.C.C are sent out on the B.B.B.0 subnet, and not following the default route.
Actual results:

UDP packets sent ignore routes on the system.

Expected results:

SNMP UDP packets should use the routing table.

Additional info:

This config is commonly encountered on routers.  Depending on which IP address is used to query SNMP, SNMP responses may or may note be correctly sent.  Incorrect behaviour is visible when the DUT sends ARP queries for C.C.C.C on subnet B.B.B.0.  Attached is a proposed fix that allows the kernel to select which interface to transmit on, while keeping the specification of the source ip address in sendmsg().

Comment 2 Jan Safranek 2012-05-29 07:42:07 UTC
You are not the first who requests such feature, but I am afraid it contradicts with other requirements.

Some people (mainly running some cluster suites or so) strictly require, that if snmpd gets a request, it must respond from the same interface. These people run servers with several network interfaces facing the same network and kernel could choose different interface when sending UDP response with cmsg.ipi.ipi_ifindex = 0.

Therefore I consider it as RFE. I'll think about introduction of new snmpd.conf option which would turn the kernel routing on/off.

Please also consider contacting your Red Hat support, bugs without support ticket have lower priority.

Comment 4 Michal Žejdl 2012-07-26 12:06:57 UTC
Created attachment 600495 [details]
patch from RHEL 5

solved already in RHEL 5 and upstream

see https://bugzilla.redhat.com/show_bug.cgi?id=600319

Problem raised with broadcast-response.patch, which was corrected later to preserve good old ipi_ifindex = 0 behavior.

I don't understand why this patch has not been applied in RHEL 6.

Comment 11 errata-xmlrpc 2013-02-21 10:27:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.


Note You need to log in before you can comment on or make changes to this bug.