History log of /freebsd-current/usr.sbin/bsnmpd/tools/libbsnmptools/bsnmptc.c
Revision Date Author Comments
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# c4114bd1 30-Dec-2016 Enji Cooper <ngie@FreeBSD.org>

Set value->v.octetstring.len to a correct value on malloc success/failure

The previous code always set value->v.octetstring.len to len, regardless
of the result from the malloc call. This misleads the caller on malloc
failure. Set .len to len on success and 0 on failure.

MFC after: 1 week
Reported by: Coverity
CID: 1007590


# e1d581b2 27-Dec-2016 Enji Cooper <ngie@FreeBSD.org>

style(9): clean up trailing whitespace

MFC after: 3 weeks


# 7c933da6 24-Dec-2016 Enji Cooper <ngie@FreeBSD.org>

Warning message cleanup

- Use warn instead of warnx + strerror(errno)
- Remove unnecessary trailing newline from a warnx call
- Add missing spaces following "," in syslog and warn* calls

MFC after: 2 weeks


# 5413861b 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Use a consistent errno save/restore pattern before running strtoul

- Save errno
- Set errno to 0
- Call strtoul
- Test errno (optional, but many calls to strtoul did this afterwards)

Some of the code was setting errno = 0 after calling strtoul, not setting
errno = 0, or setting errno to saved_errno after the call, but before the
test. These all have unwanted behavioral side-effects, depending on the
initial value of errno and whether or not the input to strtoul was correct
or incorrect.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division


# 2c004643 14-May-2016 Enji Cooper <ngie@FreeBSD.org>

Do minimal work necessary to cure a -Wunused-but-set-variable warning from gcc

How errno is saved before and restored after strtoul calls needs a rethink

MFC after: 1 week
Reported by: gcc 5.x
Sponsored by: EMC / Isilon Storage Division


# 0150b85a 13-May-2016 Enji Cooper <ngie@FreeBSD.org>

Fix some trivial clang/gcc warnings in bsnmptc.c

- By definition, `enum snmp_tc` can't be false (the implied starting sequence
index for the enum is 0). Don't test for it being < 0.
- Staticize `struct snmp_text_conv` to mute a -Wmissing-variable-declarations
warning from clang.
- Remove set but unused variable, ptr, in parse_bridge_id(..) and
parse_bport_id(..) to mute warning from gcc 4.9+.
- Mark value and string unused in snmp_inetaddr2oct(..) and parse_inetaddr(..)
as they're just stub functions.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division


# a08b636a 28-Apr-2016 Enji Cooper <ngie@FreeBSD.org>

Use a better idiom for finding UTC prefixed timezones

Instead of copy-pasting the string literal for "UTC" 3 times and using
strlen, use a static char[3] buffer and sizeof(..).

MFC after: 3 days
X-MFC with: r298507
Submitted by: kib
Sponsored by: EMC / Isilon Storage Division


# 62bc9ed5 23-Apr-2016 Enji Cooper <ngie@FreeBSD.org>

Fix looking for "UTC" at start of ptr by using strnmp instead of improperly
unrolled equivalent

CID: 1347118
MFC after: 1 week
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division


# a7398723 08-Dec-2010 Shteryana Shopova <syrinx@FreeBSD.org>

Add bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base system.

Sponsored by: The FreeBSD Foundation (the SNMPv3 bits), Google Summer of Code 2005
Reviewed by: philip@ (mostly), bz@ (earlier version based on p4 ch124545)
Approved by: philip@