summaryrefslogtreecommitdiff
path: root/usr.sbin/ifstated
AgeCommit message (Collapse)Author
2022-12-28spelling fixes; from paul tagliamonteJason McIntyre
any parts of his diff not taken are noted on tech
2021-12-13including sys/cdefs.h manually started as a result of netbsd trying toTheo de Raadt
macro-build a replacement for sccsid, and was done without any concern for namespace damage. Unfortunately this practice started infecting other code as others were unaware they didn't need the file. ok millert guenther
2021-10-15Don't declare variables as "unsigned char *" that are passed toChristian Weisgerber
functions that take "char *" arguments. Where such chars are assigned to int or passed to ctype functions, explicitly cast them to unsigned char. For OpenBSD's clang, -Wpointer-sign has been disabled by default, but when the parse.y code was built elsewhere, the compiler would complain. With help from millert@ ok benno@ deraadt@
2021-07-12Change the error reporting pattern throughout the tree when unveilBob Beck
fails to report the path that the failure occured on. Suggested by deraadt@ after some tech discussion. Work done and verified by Ashton Fagg <ashton@fagg.id.au> ok deraadt@ semarie@ claudio@
2020-12-30getifaddrs() can return entries where ifa_addr is NULL. Check for thisSebastian Benoit
before accessing anything in ifa_addr. ok claudio@
2020-05-16list example files in FILES with a short description: generally, "ExampleJason McIntyre
configuration file.", but occasionally something else fit better; at the same time, try to make the format for FILES more consistent; original diff from clematis
2020-02-10briefly mention /etc/examples/ in the FILES section of all theIngo Schwarze
manual pages that document the corresponding configuration files; OK jmc@, and general direction discussed with many
2019-06-28When system calls indicate an error they return -1, not some arbitraryTheo de Raadt
value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
2019-02-13(unsigned) means (unsigned int) which on ptrdiff_t or size_t or otherTheo de Raadt
larger types really is a range reduction... Almost any cast to (unsigned) is a bug. ok millert tb benno
2019-01-22PF_ROUTE -> AF_ROUTE in the scattered sock()/setsockopt() callsKenneth R Westerback
where the "wrong" #define was used. ok dlg@
2018-12-07"every" is in seconds; from ross l richardsonJason McIntyre
2018-11-01- odd condition/test in PF lexerAlexandr Nedvedicky
(and other lexers too) This commit rectifies earlier change: in the lex... even inside quotes, a \ followed by space or tab should expand to space or tab, and a \ followed by newline should be ignored (as a line continuation). compatible with the needs of hoststated (which has the most strict quoted string requirements), and ifstated (where one commonly does line continuations in strings). OK deraadt@, OK millert@
2018-10-31ifstated(8) needs to load configfile from within the main loop, but also toRicardo Mestre
reload it on SIGHUP so unveil(2) it with read permissions. Additionally all commands are exec'ed through /bin/sh instead of directly so we can just unveil(2) /bin/sh with x perms. OK deraadt@
2018-09-07replace malloc()+strlcpy() with strndup() in cmdline_symset().miko
"looks good" gilles@ halex@
2018-07-11Do for most running out of memory err() what was done for most runningKenneth R Westerback
out of memory log_warn(). i.e. ("%s", __func__) instead of manual function names and redundant verbiage about which wrapper detected the out of memory condition. ok henning@
2018-07-09No need to mention which memory allocation entry point failed (malloc,Kenneth R Westerback
calloc or strdup), we just need to log that we ran out of memory in a particular function. Recommended by florian@ and deraadt@ ok benno@ henning@ tb@
2018-07-08Be consistent in warn() and log_warn() usage whenKenneth R Westerback
running out of memory. Next step, be correct *and* consistent. ok dennis@ tb@ benno@ schwarze@
2018-06-18remove the SECTIONS header, since a one line DESCRIPTION is a bit silly;Jason McIntyre
use a more general text for the sections, and avoid the catchup issue that was trying to document how many there were; ok benno rob
2018-04-26Plug leak in error case of the common 'varset' implementations.Kenneth R Westerback
ok benno@
2018-03-06Initialize pushback_index like we do (mostly) everywhere else.rob
2018-03-06Mention that there is no macro expansion inside quotes.rob
ok jmc@
2018-03-03Add missing comma.rob
2018-01-20Improve the config example.Marco Pfatschbacher
Suggest using carpdemote instead of tweaking the advskew setting. Also add a check for a non-carp link state. Prodded by jmc@. OK jmc@, rob@.
2017-08-30Add support for interface departure and arrival.rob
Ok jca@, benno@
2017-08-21Remove unnecessary NULL check and fix an incorrect warning.rob
Ok jca@
2017-08-20Stop tracking interface indexes. Suggested by deraadt.rob
Tweaks and ok jca@ "just get it in" deraadt@
2017-08-14Remove some dead logging code that was never used.rob
Ok benno@
2017-08-08Use configtest as one word like other network daemon man pages.rob
Ok benno@, jmc@
2017-08-08Consistent use of log.c, and removal of err.h include. Makes ifstatedrob
configtest output the same as other networking daemons. Ok jca@
2017-08-06Improve error checking during processing of routing messages. Handling ofrob
RTM_DESYNC encouraged by deraadt. ok jca@ benno@
2017-07-24Use pledge(2)Jeremie Courreges-Anglas
Simple promises proposed by Rob Pierce after exploring more complicated privsep schemes. ok benno@
2017-07-23Don't bother initializing global variables to 0, since they will be in BSS.Theo de Raadt
ok jca
2017-07-23use ssize_t; ok jcaTheo de Raadt
2017-07-23Time comparison variables should be time_t (I did check for signed vsTheo de Raadt
unsigned handling) ok jca
2017-07-22No need for sys/ioctl.h any moreJeremie Courreges-Anglas
2017-07-21Add a newlineJeremie Courreges-Anglas
2017-07-21No need for ioctl(SIOCGIFDATA), getifaddrs(3) gives us the link stateJeremie Courreges-Anglas
Noticed while reviewing a pledge(2) diff from Rob Pierce. ok florian@
2017-07-04delete tokens that have never been used.Sebastian Benoit
From Rob Pierce ok yacc and gcc
2017-07-04rename fetch_state() to fetch_ifstate(). The word "state" is a bitSebastian Benoit
overloaded in this daemon. From Rob Pierce
2017-07-04Fix some variable alignment whitespace.Sebastian Benoit
From Rob Pierce
2017-07-03Remove obvious clear_config() comments and misleading state_change() comments.Sebastian Benoit
Also relocate do_action() calls for the init block from change_state() to occur with the corresponding do_action() calls for the body block. From Rob Pierce ok stsp@ and i
2017-07-02Second diff to rename additional "always" variable in struct ifsd_config.Sebastian Benoit
from Rob Pierce. Requested by stsp@
2017-07-02Remove unused variable from header file.Sebastian Benoit
from Rob Pierce. ok stsp@ and me
2017-07-02Remove variable assignment in declaration and add whitespace to improveSebastian Benoit
readability. No functional change. from Rob Pierce. ok stsp@ and me
2017-07-02Rename one of the "always" variables to "body" for improved readability.Sebastian Benoit
No functional change. from Rob Pierce. ok stsp@ and me
2017-06-28whitespace fixes, from Rob Pierce and meSebastian Benoit
2017-06-28usage() gets __dead attribute, from Rob PierceSebastian Benoit
2017-06-27Hoist some privileged code in preparation for future work.Sebastian Benoit
Based on an approach in vmd with mc146818/ns8250. diff by Rob Pierce <rob -AT- 2keys -DOT- ca> ok deraadt@
2017-06-18update log.c in ifstated to the same used in bgpd etc.Sebastian Benoit
Done by Rob Pierce <rob AT 2keys DOT ca>, thanks
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@