RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1768908 - Misleading "Address family for hostname not supported" from snmptrapd
Summary: Misleading "Address family for hostname not supported" from snmptrapd
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: net-snmp
Version: 8.4
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Josef Ridky
QA Contact: Evgeny Fedin
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-05 14:12 UTC by Amey
Modified: 2021-11-10 09:17 UTC (History)
2 users (show)

Fixed In Version: net-snmp-5.8-21.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-09 19:48:29 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github net-snmp net-snmp issues 199 0 None open Parsing IP address twice causes Error: Adress family for hostname not supported 2021-06-09 08:06:45 UTC
Red Hat Product Errata RHEA-2021:4439 0 None None None 2021-11-09 19:48:35 UTC

Description Amey 2019-11-05 14:12:01 UTC
NOTE:- bug #1485755 is already open for same issue in RHEL 7, but it is marked as won't fix hence raising this for RHEL 8.

Description:-
"authCommunity" directive with an IP address as "SOURCE" parameter causes snmptrapd to generate an error log "Address family for hostname not supported", which is quite misleading.

Version-Release number of selected component (if applicable):
net-snmp-5.7.2-24.el7_2.1.x86_64

How reproducible:
when an IP address or an IP network address ( IP/mask-length ) in a "authCommunity" directive in /etc/snmp/snmptrapd.conf
ex. authCommunity log,execute,net public 192.168.0.1

Steps to Reproduce:
1. create snmptrapd.conf with the following command.
  # echo "authCommunity log,execute,net public 192.168.0.1" > /etc/snmp/snmptrapd.conf
2. start snmptrapd daemon.
  # snmptrapd -Lf /tmp/s.log

Actual results:
an error message appears in the log file "/tmp/s.log" like:
---
 /etc/snmp/snmptrapd.conf: line 1: Error: Address family for hostname not supported
 net-snmp: 1 error(s) in config file(s)
 NET-SNMP version 5.7.2
---

Expected results:
no errors should be reported.

Additional info:
this seems a bug in IP address parsing functionality of snmptrapd.
i watched with gdb how the daemon parse an address.
the daemon did parse twice per address, both as IPv4 at first and as IPv6 at second, even if the address had proved to be a valid IPv4 address.
i think this second trial ( parsing addres as IPv6 ) generated the error message.

the gdb log below shows:
 first, the daemon called inet_pton() with AF_INET(2) in netsnmp_udp_parse_security(). this was IPv4 address parsing.
 second, the daemon called inet_pton() with AF_INET6(10) in netsnmp_udp6_parse_security(). this was IPv6 address parsing.
---
# gdb /usr/sbin/snmptrapd
GNU gdb (GDB) Red Hat Enterprise Linux 7.6.1-94.el7
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /usr/sbin/snmptrapd...Reading symbols from /usr/sbin/snmptrapd...(no debugging symbols found)...done.
(no debugging symbols found)...done.
Missing separate debuginfos, use: debuginfo-install net-snmp-5.7.2-24.el7_2.1.x86_64
(gdb) b main
Breakpoint 1 at 0x2ea0
(gdb) run -Lf /tmp/s.log
Starting program: /usr/sbin/snmptrapd -Lf /tmp/s.log
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Breakpoint 1, 0x0000555555556ea0 in main ()
(gdb) b inet_pton
Breakpoint 2 at 0x7ffff5a42240
(gdb) c
Continuing.

Breakpoint 2, 0x00007ffff5a42240 in inet_pton () from /lib64/libc.so.6
(gdb) p $rdi
$1 = 2
(gdb) x/s $rsi
0x7fffffff5290: "192.168.0.1"
(gdb) where
#0  0x00007ffff5a42240 in inet_pton () from /lib64/libc.so.6
#1  0x00007ffff6b88548 in netsnmp_udp_parse_security () from /lib64/libnetsnmp.so.31
#2  0x00007ffff74fb79b in vacm_gen_com2sec () from /lib64/libnetsnmpagent.so.31
#3  0x00007ffff74fc800 in vacm_create_simple () from /lib64/libnetsnmpagent.so.31
#4  0x00007ffff74fc8d0 in vacm_parse_authcommunity () from /lib64/libnetsnmpagent.so.31
#5  0x00007ffff6b5c436 in run_config_handler () from /lib64/libnetsnmp.so.31
#6  0x00007ffff6b5cffd in read_config () from /lib64/libnetsnmp.so.31
#7  0x00007ffff6b5dffb in read_config_files_in_path () from /lib64/libnetsnmp.so.31
#8  0x00007ffff6b5e418 in read_config_files_of_type () from /lib64/libnetsnmp.so.31
#9  0x00007ffff6b5e4a3 in read_config_files () from /lib64/libnetsnmp.so.31
#10 0x00007ffff6b5e5f4 in read_configs () from /lib64/libnetsnmp.so.31
#11 0x00005555555577eb in main ()
(gdb) c
Continuing.

Breakpoint 2, 0x00007ffff5a42240 in inet_pton () from /lib64/libc.so.6
(gdb) p $rdi
$2 = 10
(gdb) x/s $rsi
0x7fffffff5270: "192.168.0.1"
(gdb) where
#0  0x00007ffff5a42240 in inet_pton () from /lib64/libc.so.6
#1  0x00007ffff6b865b1 in netsnmp_udp6_parse_security () from /lib64/libnetsnmp.so.31
#2  0x00007ffff74fb79b in vacm_gen_com2sec () from /lib64/libnetsnmpagent.so.31
#3  0x00007ffff74fc226 in vacm_create_simple () from /lib64/libnetsnmpagent.so.31
#4  0x00007ffff74fc8d0 in vacm_parse_authcommunity () from /lib64/libnetsnmpagent.so.31
#5  0x00007ffff6b5c436 in run_config_handler () from /lib64/libnetsnmp.so.31
#6  0x00007ffff6b5cffd in read_config () from /lib64/libnetsnmp.so.31
#7  0x00007ffff6b5dffb in read_config_files_in_path () from /lib64/libnetsnmp.so.31
#8  0x00007ffff6b5e418 in read_config_files_of_type () from /lib64/libnetsnmp.so.31
#9  0x00007ffff6b5e4a3 in read_config_files () from /lib64/libnetsnmp.so.31
#10 0x00007ffff6b5e5f4 in read_configs () from /lib64/libnetsnmp.so.31
#11 0x00005555555577eb in main ()
(gdb) c
Continuing.
Detaching after fork from child process 15338.
[Inferior 1 (process 15320) exited normally]
---

Comment 19 errata-xmlrpc 2021-11-09 19:48:29 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 (net-snmp bug fix and enhancement update), and where to find the updated
files, follow the link below.

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

https://access.redhat.com/errata/RHEA-2021:4439


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