Thanks for spotting this. Looks correct, but if I were to fix this: (v == 0) ? 2 : 1
Either case, OK uebayasi@ On Wed, Oct 07, 2015 at 10:39:17PM +0100, Stuart Henderson wrote: > IP-MIB::ipForwarding.0 should return one of these values: > > ipForwarding OBJECT-TYPE > SYNTAX INTEGER { > forwarding(1), -- acting as a router > notForwarding(2) -- NOT acting as a router > } > > Currently we directly return the value of sysctl net.inet.ip.forwarding > which is incorrect. > > OK to fix it like this? > > Index: mib.c > =================================================================== > RCS file: /cvs/src/usr.sbin/snmpd/mib.c,v > retrieving revision 1.76 > diff -u -p -r1.76 mib.c > --- mib.c 10 Jun 2015 10:03:59 -0000 1.76 > +++ mib.c 7 Oct 2015 21:34:27 -0000 > @@ -2984,7 +2984,7 @@ mib_ipforwarding(struct oid *oid, struct > if (sysctl(mib, sizeofa(mib), &v, &len, NULL, 0) == -1) > return (-1); > > - *elm = ber_add_integer(*elm, v); > + *elm = ber_add_integer(*elm, v ? 1 : 2); > > return (0); > } >