> a number of systems (including OSX, AIX, IRIX and Tru64) have known problems
> when using nlist/klookup (/dev/kmem access) for a number of reasons. A minimal
> stop-gap fix is to turn off nlist/klookup usage completely, most conveniently
> done by "configure --without-kmem-usage" (which prevents NETSNMP_CAN_USE_NLIST
> from being defined).
> 
> However, this configuration currently either:
> - requires you to build a crippled mini agent, or
> - otherwise yields into compile errors saying that NETSNMP_KLOOKUP has been
> used, but couldn't be found, because it's only defined when
> NETSNMP_CAN_USE_NLIST is defined, too.

I have a few concerns with this patch.

One is side-effects. In particular, all these breaks and returns are changing
code paths.

The other is, is there really any benefit here? While it allows one to remove
--enable-mini-agent, it will just enable a bunch of code that isn't going to
do anything, right? Why does a broken nlist/klookup require
--enable-mini-agent? It it because some modules that use those APIs don't
properly ifdef when those functions aren't available? If so, it seems like
fixing those modules would be cleaner than including a bunch of code that
isn't going to do anything.


> -        NETSNMP_KLOOKUP(at_ptr, (char *) &at_entry, sizeof(struct arptab));
> -        NETSNMP_KLOOKUP(at_entry.at_ac, (char *) &at_com, sizeof(struct 
> arpcom));
> +        if (!NETSNMP_KLOOKUP(at_ptr, (char *) &at_entry, sizeof(struct 
> arptab))) {
> +            DEBUGMSGTL(("mibII/at:ARP_Scan_Next", "klookup failed\n"));
> +            break;
> +        }
> +
> +        if (!NETSNMP_KLOOKUP(at_entry.at_ac, (char *) &at_com, sizeof(struct 
> arpcom))) {
> +            DEBUGMSGTL(("mibII/at:ARP_Scan_Next", "klookup failed\n"));
> +            break;
> +        }

If you aren't going to log unique messages, then I'd prefer the more concise:

> +        if (!NETSNMP_KLOOKUP(at_ptr, (char *) &at_entry, sizeof(struct 
> arptab)) ||
> +            !NETSNMP_KLOOKUP(at_entry.at_ac, (char *) &at_com, sizeof(struct 
> arpcom))) {
> +            DEBUGMSGTL(("mibII/at:ARP_Scan_Next", "klookup failed\n"));
> +            break;
> +        }


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to