Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-101078

snmptrapd has inverted use of "-n" bug

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • rhel-9.8
    • rhel-9.6, rhel-10.0.z
    • net-snmp
    • None
    • Yes
    • Low
    • rhel-base-utils-core
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • All
    • None

      Upstream introduced bug, inverting the result of testing the "-n" switch in commit 99fedfe1238a7cc1bae4d44f49314a58a3649f73

      In 5.7.* (rhel8) or earlier, in apps/snmptrapd_log.c it would perform,

       

        if (!netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
                                 NETSNMP_DS_APP_NUMERIC_IP))

        { host = netsnmp_gethostbyaddr((char *) pdu->agent_addr, 4, AF_INET); }

       

      but following the commit it calls a new routine  convert_agent_addr() which does

       

          const int numeric = !netsnmp_ds_get_boolean(NETSNMP_DS_APPLICATION_ID,
                                                      NETSNMP_DS_APP_NUMERIC_IP);

         [...]

         if (getnameinfo((struct sockaddr *)&sin, sizeof(sin), name, size, NULL, 0,
                          numeric ? NI_NUMERICHOST : 0) < 0)
              strlcpy(name, "?", sizeof(size));

       

      The fix is simply the removal of the inversion on the assignment.

       

         

        1. image-2025-06-30-16-56-10-530.png
          0.0 kB
          Martin Poole
        2. image-2025-06-30-16-56-43-198.png
          0.1 kB
          Martin Poole
        3. image-2025-06-30-16-56-48-430.png
          0.1 kB
          Martin Poole

              jridky Josef Řídký
              rhn-support-mpoole Martin Poole
              Josef Řídký Josef Řídký
              Jakub Haruda Jakub Haruda
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: