Bug 825889 - snmpd transmits reply UDP packets on incorrect interface
snmpd transmits reply UDP packets on incorrect interface
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: net-snmp (Show other bugs)
6.2
All Linux
unspecified Severity medium
: rc
: ---
Assigned To: Jan Safranek
Dalibor Pospíšil
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-28 20:56 EDT by Benjamin LaHaise
Modified: 2013-11-21 15:02 EST (History)
3 users (show)

See Also:
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.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-02-21 05:27:11 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Benjamin LaHaise 2012-05-28 20:56:47 EDT
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):

net-snmp-5.5-37.el6.x86_64

How reproducible:

Always.

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 03:42:07 EDT
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 08:06:57 EDT
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 05:27:11 EST
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.

http://rhn.redhat.com/errata/RHBA-2013-0421.html

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