On 2019/08/13 13:29, Stuart Henderson wrote:
> On 2019/08/13 13:50, Claudio Jeker wrote:
> > In that case you want to use ifi_iqdrops in struct if_data.
> > So maybe something like the appended diff could work.
> 
> OK sthen@ for this one.
> 
> > Then there is also case 21 that gets net.inet.ip.ifq.len which needs to be
> > changed too.
> 
> I don't we have a good value to use here, besides that is deprecated in IF-MIB
> anyway.
> 
> ifOutQLen OBJECT-TYPE
>     SYNTAX      Gauge32
>     MAX-ACCESS  read-only
>     STATUS      deprecated
>     DESCRIPTION
>             "The length of the output packet queue (in packets)."
>     ::= { ifEntry 21 }
> 
> I think this would be reasonable ..

Actually mib/len are no longer needed, so:

--- mib.c-      Tue Aug 13 13:28:03 2019
+++ mib.c       Tue Aug 13 13:30:47 2019
@@ -1106,9 +1106,6 @@ mib_iftable(struct oid *oid, struct ber_oid *o, struct
        u_int32_t                idx = 0;
        struct kif              *kif;
        long long                i;
-       size_t                   len;
-       int                      ifq;
-       int                      mib[] = { CTL_NET, PF_INET, IPPROTO_IP, 0, 0 };
 
        /* Get and verify the current row index */
        idx = o->bo_id[OIDIDX_ifEntry];
@@ -1227,15 +1224,7 @@ mib_iftable(struct oid *oid, struct ber_oid *o, struct
                ber_set_header(ber, BER_CLASS_APPLICATION, SNMP_T_COUNTER32);
                break;
        case 21:
-               mib[3] = IPCTL_IFQUEUE;
-               mib[4] = IFQCTL_LEN;
-               len = sizeof(ifq);
-               if (sysctl(mib, sizeofa(mib), &ifq, &len, 0, 0) == -1) {
-                       log_info("mib_iftable: %s: invalid ifq: %s",
-                           kif->if_name, strerror(errno));
-                       return (-1);
-               }
-               ber = ber_add_integer(ber, ifq);
+               ber = ber_add_integer(ber, 0);
                ber_set_header(ber, BER_CLASS_APPLICATION, SNMP_T_GAUGE32);
                break;
        case 22:

Reply via email to