Date: Fri, 15 Dec 2006 20:01:57 +0000 (UTC) From: Shteryana Shopova <syrinx@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/usr.sbin/bsnmpd/modules/snmp_bridge bridge_addrs.c bridge_if.c bridge_pf.c bridge_port.c bridge_snmp.c bridge_sys.c Message-ID: <200612152001.kBFK1vne019967@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
syrinx 2006-12-15 20:01:57 UTC
FreeBSD src repository
Modified files:
usr.sbin/bsnmpd/modules/snmp_bridge bridge_addrs.c bridge_if.c
bridge_pf.c bridge_port.c
bridge_snmp.c bridge_sys.c
Log:
Do not add 'default:' cases inside a switch() on an enum like the
SNMP option argument. That way the compiler will give a warning in
case of a missing or an extra but unknown 'case:'.
Do the same for SNMP LEAF objects to be prepared once gensnmptree will
auto-generate enums for those too.
Add an abort() after the switch() instead of the 'default:' to catch
any errors. The nice side effect is that the compiler will correctly
track supposed to be 'uninitialized' variables with that.
When trying to set a value sanity check it before calling the OS
dependent API of snmp_bridge to tell whether it is an attempt to
set a bad value or a general error.
Suggested by: harti (first part)
Approved by: bz (mentor)
Revision Changes Path
1.3 +18 -22 src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_addrs.c
1.4 +196 -152 src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_if.c
1.2 +14 -15 src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_pf.c
1.4 +256 -175 src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_port.c
1.3 +13 -10 src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_snmp.c
1.3 +1 -43 src/usr.sbin/bsnmpd/modules/snmp_bridge/bridge_sys.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612152001.kBFK1vne019967>
