summaryrefslogtreecommitdiff
path: root/usr.sbin/snmpd
AgeCommit message (Collapse)Author
2017-08-20Check that we haven't yet reached the end of the string before callingTheo Buehler
strcspn(3) instead of afterwards. Fixes an out-of-bound read that led to intermittent crashes experienced by rob in his regression test. ok rob
2017-08-12Make not yet implemented pledges more visible in grep output.Florian Obser
input benno, deraadt, tedu also standardize on #if 0 since it makes tedu's editor vomit. OK benno, pirofti on a previous version
2017-08-12Initial pledge for snmpd. snmpe remains unpledged. Regression tests pass.rob
Ok benno@, jca@.
2017-07-28Make the engine id is just binary data so make it uint8_t.Florian Obser
clang pointed out that we tried to store 128 in a signed char. OK gerhard
2017-07-28Use a format string for yyerror when printing a variable string.Florian Obser
Pointed out by clang. (Not really a problem here since we control the string, but these things tend to get coppied around) ok gerhard@
2017-07-27Heed the non-repeaters of GetBulkRequests and make sure to setGerhard Roth
error-status and error-index to zero in the response PDU. ok sthen@
2017-07-24Unify ROUNDUP macros for parsing route messages.friehm
Use the macro from route(8) / ospf6d(8) since it works also with argument 0. OK claudio@
2017-07-03no need to generate y.tab.h if nothing uses it, set YFLAGS to nothingMarc Espie
instead of CLEANFILES += y.tab.h okay millert@
2017-06-01Return time_uptime as value for when pf was enabled instead ofPatrick Wildt
time_second. Since time_second changes depending on the wall- clock time, time_second is not a reliable source for the status. We can even end up with a negative time delta. Thus, use the monotonically growing time_uptime and export it to userland. ok bluhm@ mikeb@
2017-05-29sync proc.c changes from relayd/httpdSebastian Benoit
2017-04-21Repair AgentX support.Jeremie Courreges-Anglas
which I broke when adding support for multiple listen address. SNMP data should be sent to the client using the appropriate socket, which we now store when we receive the query. Reported & fix tested by Rivo Nurges.
2017-04-21Fix uninitialized variable that coult result in a crash.Jeremie Courreges-Anglas
Fix from Rivo Nurges.
2017-04-04Rewrite tohexstr() to use the common idiom of converting a byteTodd C. Miller
string to hex nybble by nybble. This avoids using the return value of snprintf() unchecked. OK deraadt@
2017-03-21From a syslog perspective it does not make sense to log fatal andAlexander Bluhm
warn with the same severity. Switch log_warn() to LOG_ERR and keep fatal() at LOG_CRIT. OK reyk@ florian@
2017-01-31Don't include a literal "%" in the value for humidity sensorValue inStuart Henderson
OPENBSD-SENSORS-MIB, % is the unit for this value and is already present in sensorUnits, and it's harder for NMS to parse "100.00%" as a number. From Joel Knight.
2017-01-20Because of pfsync this needs ip_ipsp.h. Missed in the pfsockaddr_union cleanup.Claudio Jeker
Found by krw@
2017-01-17Nuke some whitespace that keeps poking me in the eye as I try toKenneth R Westerback
steal code.
2017-01-09Stop accessing verbose and debug variables from log.c directly.Reyk Floeter
This replaces log_verbose() and "extern int verbose" with the two functions log_setverbose() and log_getverbose(). Pointed out by benno@ OK krw@ eric@ gilles@ (OK gilles@ for the snmpd bits as well)
2017-01-08Sync log.c with the latest version from vmd/log.c that preserves errnoReyk Floeter
so it is safe calling log_* after an error without loosing the it.
2017-01-05Replace hand-rolled for(;;) emptying of 'symhead' TAILQ with moreKenneth R Westerback
modern TAILQ_FOREACH_SAFE(). No intentional functional change. ok millert@ bluhm@ gilles@
2017-01-05Replace symset()'s hand-rolled for(;;) traversal of 'symhead' TAILQKenneth R Westerback
with more modern TAILQ_FOREACH(). This what symget() was already doing. Add paranoia '{}' around body of symget()'s TAILQ_FOREACH(). No intentional functional change. ok bluhm@ otto@
2016-11-18Add support for multiple listening socketsJeremie Courreges-Anglas
One can now specify multiple "listen on" statements. The default is to listen on 0.0.0.0 and ::, which means better handling of dual-stack setups. ok sthen@ on a previous version, input and ok reyk@.
2016-11-09Improve source IP address handling.Jeremie Courreges-Anglas
- send replies using a source address equal to the destination address of queries, using IP_SENDSRCADDR. This help in multihomed setups and can remove the need to explicitely configure a bind address. - config knob to set the source address of packets sent to trap receivers. "trap receiver" gains an optional "source-address" setting. Source address issues reported by Andy Lemin. ok benno@
2016-10-28Sync snmpd(8) with other daemons proc.c and teach him how to fork+exec.Rafael Zalamena
ok jca@, reyk@
2016-10-28Use snmpd_env as the only global variable for env to simplify the daemonRafael Zalamena
and avoid problems. ok jca@
2016-10-12copy updated log.c from vmd: for correctness, save errno when doingReyk Floeter
additional actions before printing it. OK rzalamena@
2016-10-03use EVP_CipherFinal_ex instead of EVP_CipherFinalDavid Gwynne
EVP_CipherFinal_ex has well defined behaviour, where EVP_CipherFinal can vary depending on the version of your ssl library. ok bcook@ jsing@
2016-10-03include sys/tree.h explicitly rather than rely on a random pf headerDavid Gwynne
to do it. ok deraadt@
2016-09-26Fix compilation warning by using the correct cast/format.Rafael Zalamena
improved by sthen@ ok reyk@
2016-09-25Remove more duplicated includesFrederic Cambus
OK jca@, deraadt@
2016-09-03Fix pasto; zero ka->dstbrd instead of clobbering ka->mask.Jeremie Courreges-Anglas
Diff from Jan Klemkow, ok mikeb@
2016-09-02use imsg_read_nofd() implementation from bgpd.Eric Faurot
let the caller handle EAGAIN. ok reyk@ gilles@
2016-08-27Pull in <sys/time.h> for struct timespec, timeval, or clockratePhilip Guenther
ok deraadt@
2016-08-16stop including sys/param.h for nitems. define locally as needed.Ted Unangst
ok natano reyk
2016-06-21do not allow whitespace in macro names, i.e. "this is" = "a variable".Sebastian Benoit
change this in all config parsers in our tree that support macros. problem reported by sven falempin. feedback from henning@, stsp@, deraadt@ ok florian@ mikeb@
2016-03-07http -> https for IETF/IANA URLs in commentsmmcc
2016-03-05mirror memset changes to ber.c made in ldapd (these 3 daemonsTheo de Raadt
have subtly modified copies of the file) from rob pierce
2016-02-02Remove setproctitle() for the parent process. Because rc.d(8) uses processStuart Henderson
titles (including flags) to distinguish between daemons, this makes it possible to manage multiple copies of a daemon using the normal infrastructure by symlinking rc.d scripts to a new name. ok jung@ ajacoutot@, smtpd ok gilles@
2016-01-25avoid a potential double freeJonathan Gray
ok blambert@
2015-12-24more e-mail -> emailmmcc
2015-12-07Add imsg "peerid" to debug messages (only within -DDEBUG).Reyk Floeter
2015-12-07Sync proc.c, use proc_composev()Reyk Floeter
2015-12-07sync with vmdReyk Floeter
2015-12-05EAGAIN handling for imsg_read. OK henning@ benno@Claudio Jeker
2015-12-05strings.h -> string.h to prevent an implicit declaration warning. Alsommcc
remove a handful of NULL-checks before free().
2015-11-23Use SOCK_NONBLOCK to replace socket_set_blockmode() and fcntl(..O_NONBLOCK).Reyk Floeter
(SOCK_CLOEXEC should also be added where it is appropriate, but this is OBnot done in this commit yet.) OK claudio@
2015-11-23Sync proc.c with ikedReyk Floeter
2015-11-22Update log.c: change fatal() and fatalx() into variadic functions,Reyk Floeter
include the process name, and replace all calls of fatal*(NULL) with fatal(__func__) for better debugging. OK benno@
2015-11-21Once again, fix the license text. After many years, we just cannotReyk Floeter
get rid of the "LOSS OF MIND" joke. Haha. We keep on removing it and it shows up again because it accidentally gets synced from somewhere else. bgpd and ospfd don't have it anymore, but their offsprings still carry it. If you see it, remove it, and, in the OpenBSD ISC case, use the original text from /usr/share/misc/license.template. All authors agree.
2015-11-21While here, fix two size format string warnings.Reyk Floeter