From 8eb8d24c9f2a0eb8e1a525a8a554979fd6efae55 Mon Sep 17 00:00:00 2001 From: sthen Date: Thu, 8 Oct 2015 07:26:34 +0000 Subject: [PATCH] use correct return value for IP-MIB::ipForwarding, tweak/ok uebayasi@ --- usr.sbin/snmpd/mib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c index 80e1dcf519f..14cf3060a79 100644 --- a/usr.sbin/snmpd/mib.c +++ b/usr.sbin/snmpd/mib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mib.c,v 1.77 2015/10/05 15:29:14 uebayasi Exp $ */ +/* $OpenBSD: mib.c,v 1.78 2015/10/08 07:26:34 sthen Exp $ */ /* * Copyright (c) 2012 Joel Knight @@ -2984,7 +2984,7 @@ mib_ipforwarding(struct oid *oid, struct ber_oid *o, struct ber_element **elm) if (sysctl(mib, sizeofa(mib), &v, &len, NULL, 0) == -1) return (-1); - *elm = ber_add_integer(*elm, v); + *elm = ber_add_integer(*elm, (v == 0) ? 2 : 1); return (0); } -- 2.20.1