add simple ifstated regression test script

2017-07-02 Thread Rob Pierce
I am currently using this regression script for basic ifstated sanity testing. Still a work in progress. Requesting commit for safe keeping. Regards, Rob Index: usr.sbin/ifstated/ifstated.sh === RCS file:

ifstated parse.y removed unused tokens

2017-07-04 Thread Rob Pierce
These tokens have existed since version 1.1 but have never been used. Can we delete them? Rob Index: parse.y === RCS file: /cvs/src/usr.sbin/ifstated/parse.y,v retrieving revision 1.43 diff -u -p -r1.43 parse.y --- parse.y 2

Re: ifstated diff rename variables to avoid state confusion

2017-07-04 Thread Rob Pierce
On Mon, Jul 03, 2017 at 04:24:30PM -0400, Rob Pierce wrote: > ifstated monitors interface state and the return state of invoked commands, > and takes action accordingly, all of which is managed with the help of a > finite state machine. That makes for a lot of "state" ref

ifstated diff rename variables to avoid state confusion

2017-07-03 Thread Rob Pierce
ifstated monitors interface state and the return state of invoked commands, and takes action accordingly, all of which is managed with the help of a finite state machine. That makes for a lot of "state" references in the code. The following diff renames variables to make a distinction between

ifstated readability diff

2017-07-02 Thread Rob Pierce
Remove obvious clear_config() comments and misleading state_change() comments. Also relocate do_action() calls for the init block from change_state() to occur with the corresponding do_action() calls for the body block within the calling function for improved readability. No functional change.

Re: ifstated readability diff

2017-07-03 Thread Rob Pierce
On Sun, Jul 02, 2017 at 11:50:56PM -0400, Rob Pierce wrote: > Remove obvious clear_config() comments and misleading state_change() comments. > > Also relocate do_action() calls for the init block from change_state() to > occur with the corresponding do_action() calls for the body

ifstated unused variable

2017-07-01 Thread Rob Pierce
Remove unused variable from header file. Index: ifstated.h === RCS file: /cvs/src/usr.sbin/ifstated/ifstated.h,v retrieving revision 1.12 diff -u -p -r1.12 ifstated.h --- ifstated.h 28 Jun 2017 11:10:08 - 1.12 +++

ifstated whitespace diff

2017-07-03 Thread Rob Pierce
Fix some variable alignment whitespace. Rob Index: ifstated.h === RCS file: /cvs/src/usr.sbin/ifstated/ifstated.h,v retrieving revision 1.15 diff -u -p -r1.15 ifstated.h --- ifstated.h 2 Jul 2017 15:28:26 - 1.15 +++

rename variable in ifstated

2017-07-01 Thread Rob Pierce
never.never say always.always. Rename one of the "always" variables to "body" for improved readability. No functional change. >From ifstated.conf(5): "Each state consistes of an init block and a body. The init block is used to initialize the state and is executed each time the state is

ifstated remove unused logging code

2017-07-05 Thread Rob Pierce
This code has been here since version 1.1/1.2, but never used. Rob Index: ifstated.c === RCS file: /cvs/src/usr.sbin/ifstated/ifstated.c,v retrieving revision 1.50 diff -u -p -r1.50 ifstated.c --- ifstated.c 4 Jul 2017 21:09:52

ifstated: improve routing socket error handling

2017-08-05 Thread Rob Pierce
Improve error checking during processing of routing messages. Handling of RTM_DESYNC encouraged by deraadt. Regression tests pass. I have another diff ready to go that handles interface depature, but I thought it best to separate them. Ok? Index: ifstated.c

Re: ifstated: add handing of departed interfaces

2017-08-08 Thread Rob Pierce
On Tue, Aug 08, 2017 at 12:12:43AM +0200, Jeremie Courreges-Anglas wrote: > On Sun, Aug 06 2017, Rob Pierce <r...@2keys.ca> wrote: > > The following diff adds support for detecting the state change of a departed > > interface. ifstated is not a very verbose daemon, so t

ifstated diff: handling interface depature/arrival

2017-07-31 Thread Rob Pierce
Good evening all, Currently, ifstated does not detect the removal of an IFT_CARP pseudo device. As such, you can delete a carp interface and have ifstated happily remain in the current state without detecting any interface change. The reasons are two fold: 1. The routing socket is only

Re: ifstated diff: handling interface depature/arrival

2017-08-01 Thread Rob Pierce
On Mon, Jul 31, 2017 at 05:59:46PM -0400, Rob Pierce wrote: > Good evening all, > > Currently, ifstated does not detect the removal of an IFT_CARP pseudo device. > As such, you can delete a carp interface and have ifstated happily remain in > the current state without detectin

Re: ifstated: consistent use of log.c

2017-08-07 Thread Rob Pierce
On Sun, Aug 06, 2017 at 06:47:38PM +0200, Jeremie Courreges-Anglas wrote: > On Thu, Aug 03 2017, Rob Pierce <r...@2keys.ca> wrote: > > As a result ifstated.c no longer needs err.h. > > > > Index: ifstated.c > > =

ifstated: add handing of departed interfaces

2017-08-06 Thread Rob Pierce
The following diff adds support for detecting the state change of a departed interface. ifstated is not a very verbose daemon, so this diff quietly does the right thing (i.e. there is no exttra warning about a departing interface). The re-arrival of a departed interface involves re-indexing the

ifstated.c hoist code in prep for future work

2017-06-27 Thread Rob Pierce
Hoist some privileged code in preparation for future work. Is this the correct use of intptr_t? Based on an approach in vmd with mc146818/ns8250. No intended functional change. Rob Index: ifstated.c === RCS file:

minor bgpd.c diff

2017-06-27 Thread Rob Pierce
rfd does not need to be global. Rob Index: bgpd.c === RCS file: /cvs/src/usr.sbin/bgpd/bgpd.c,v retrieving revision 1.189 diff -u -p -r1.189 bgpd.c --- bgpd.c 28 May 2017 15:16:33 - 1.189 +++ bgpd.c 27 Jun 2017

update logging in ifstated

2017-06-11 Thread Rob Pierce
This minimizes differences with the latest log.c. I was not sure how to handle verbosity, as the current implementation is verbose by default in debug mode. The diff below requires actually requesting (double) verbosity on the command line in order to retain the same behaviour (in debug mode).

Re: update logging in ifstated

2017-06-13 Thread Rob Pierce
On Tue, Jun 13, 2017 at 08:44:46AM +0200, Sebastian Benoit wrote: > Rob Pierce(r...@2keys.ca) on 2017.06.11 18:04:31 -0400: > > This minimizes differences with the latest log.c. > > > > I was not sure how to handle verbosity, as the current implementation is > > verbo

remove errant ifstated whitespace

2017-06-27 Thread Rob Pierce
Index: ifstated.c === RCS file: /cvs/src/usr.sbin/ifstated/ifstated.c,v retrieving revision 1.43 diff -u -p -r1.43 ifstated.c --- ifstated.c 27 Jun 2017 20:46:34 - 1.43 +++ ifstated.c 28 Jun 2017 01:30:02 - @@ -151,12

delaying the start of ifstated in /etc/rc

2017-08-30 Thread Rob Pierce
Depending on the use case for ifstated, dependencies may exist with other daemons for performing interface checks and/or external tests. For example, one might use ifstated to check a dhcpd enabled interface, or connectivity to a vmd virtual machine. Does anyone have any objections with delaying

Re: delaying the start of ifstated in /etc/rc

2017-09-26 Thread Rob Pierce
On Wed, Aug 30, 2017 at 08:30:52PM -0400, Rob Pierce wrote: > Depending on the use case for ifstated, dependencies may exist with other > daemons for performing interface checks and/or external tests. For example, > one might use ifstated to check a dhcpd enabled interface, or con

diff for snmpd agentx.c

2018-06-10 Thread Rob Pierce
This brings snmpd agentx.c closer to relayd agentx.c. In the remaining delta, I am not sure if the pdu context code should be removed from the snmpd version or added to the relayd version. Anyway, this is one step closer. Ok? Rob Index: agentx.c

synchronize ber.c and ber.h across four consumers

2018-06-29 Thread Rob Pierce
This diff is a final synchronization of ber.c and ber.h. It basically takes (2012) ber additions to snmpd and adds them back to ldap, ldapd, and ypldap instances. See usr.sbin/snmpd/ber.c revision 1.24 commit log for a summary of those changes (e.g. SNMPv2 traps, User-based Security Model,

sync calloc call in ber.c

2018-06-27 Thread Rob Pierce
This ber.c change has been in ldapd since rev 1.1 and was applied to snmpd back in 2012. The following diff applies the change to the ldap client and ypldap. Ok? Index: usr.bin/ldap/ber.c === RCS file: /cvs/src/usr.bin/ldap/ber.c,v

next step in synchronizing ber.c and ber.h

2018-06-27 Thread Rob Pierce
The following diff makes ber.c and ber.h identical across ldap, ldapd, and ypldap, and slightly reduces the diff with snmpd. It covers the evolution of a few scattered enhancements, including: - sync proscription of indefinite length BER encoding - sync consistent presence of

ber.c fix for length calculations

2018-06-24 Thread Rob Pierce
It looks like a BER problem found while testing the new ldap client (with an empty password) was already addressed in snmpd back in 2010 by martinh. In LDAP under a CONTEXT class, 0 corresponds to LDAP_AUTH_SIMPLE. This is currently interpreted as an EOC (end-of-content) and causes a

call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-06-30 Thread Rob Pierce
I recently committed a piece of BER code synchronizing in the wrong direction (i.e. from the ldap instances to the snmpd instance). sthen@ noticed a break in SNMPv3 authentication and reverted that part of the change. Thanks Stuart! I just fixed some typos in the snmpd regression test which

Re: [PATCH] fix typo in if_aue.c

2018-07-02 Thread Rob Pierce
Ok rob@ > From: "Kevin Lo" > To: "tech" > Sent: Monday, July 2, 2018 10:23:39 AM > Subject: [PATCH] fix typo in if_aue.c > Hi, > I've just noticed a little typo in the if_aue.c (s/read/write). > The diff is below. > Index: sys/dev/usb/if_aue.c >

Re: [PATCH] mos: nuke unused variable

2018-07-02 Thread Rob Pierce
Ok rob@ > From: "Kevin Lo" > To: "tech" > Sent: Monday, July 2, 2018 10:22:58 AM > Subject: [PATCH] mos: nuke unused variable > Ok ? > Index: sys/dev/usb/if_mos.c > === > RCS file: /cvs/src/sys/dev/usb/if_mos.c,v > retrieving

Re: call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-07-03 Thread Rob Pierce
On Tue, Jul 03, 2018 at 09:25:06PM +0100, Stuart Henderson wrote: > On 2018/07/03 22:17, Claudio Jeker wrote: > > I have a hard time to understand why this is needed in snmpd. > > For single char reads ber_readbuf(b, c, 1) and ber_read(b, c, 1) should do > > exaclty the same. At least in the old

avoid vfprintf NULL errors in ldape.c log_debug()

2018-07-03 Thread Rob Pierce
Running the current ldapd regression tests result in the following (repeated) errors in my /var/log/messages: ... ldapd: vfprintf %s NULL in "current bind dn = %s " This is because regress/usr.sbin/ldapd/run-tests.pl is performing unnecessary unbinds in END { }. Though the regression test

snmpd trap.c uninitialized variable

2018-01-20 Thread Rob Pierce
The pid_t confused me, but I believe this is correct - i.e. referring to the packet id as oppose to a process id. Comments? Ok? Index: trap.c === RCS file: /cvs/src/usr.sbin/snmpd/trap.c,v retrieving revision 1.29 diff -u -p -r1.29

snmpd agentx.c cleanup

2018-02-12 Thread Rob Pierce
This reduces the diff with relayd/agentx.c. Ok? Index: agentx.c === RCS file: /cvs/src/usr.sbin/snmpd/agentx.c,v retrieving revision 1.11 diff -u -p -r1.11 agentx.c --- agentx.c5 Jan 2018 08:13:32 - 1.11 +++ agentx.c

Re: snmpd agentx.c cleanup

2018-02-12 Thread Rob Pierce
On Mon, Feb 12, 2018 at 03:03:07PM -0500, Rob Pierce wrote: > This reduces the diff with relayd/agentx.c. A little bit closer now. ok? Index: agentx.c === RCS file: /cvs/src/usr.sbin/snmpd/agentx.c,v retrieving revision 1.11 d

Re: please test: unveil for ifconfig

2018-08-02 Thread Rob Pierce
- Original Message - > From: "Rob Pierce" > To: "Bryan Steele" > Cc: "tech" > Sent: Thursday, August 2, 2018 1:30:15 PM > Subject: Re: please test: unveil for ifconfig > - Original Message - > > From: "Bryan Steele"

relocate some public ber functions

2018-07-30 Thread Rob Pierce
Some public ber functions sneaked in below the internal functions comment. Move them up so the comment regains its former truthiness. Ok? Index: usr.bin/ldap/ber.c === RCS file: /cvs/src/usr.bin/ldap/ber.c,v retrieving revision 1.14

Re: tweaks to namei.9

2018-08-02 Thread Rob Pierce
On Thu, Aug 02, 2018 at 03:15:14PM +0100, Jason McIntyre wrote: > On Thu, Aug 02, 2018 at 01:58:38PM +0000, Rob Pierce wrote: > > A little less wordy when introducing the namieidata structure. > > > > Ok? &g

tweaks to namei.9

2018-08-02 Thread Rob Pierce
A little less wordy when introducing the namieidata structure. Ok? Index: namei.9 === RCS file: /cvs/src/share/man/man9/namei.9,v retrieving revision 1.18 diff -u -p -r1.18 namei.9 --- namei.9 23 Nov 2015 17:53:57 -

avoid overflow in snmp message id

2018-08-10 Thread Rob Pierce
Prevent server side (snmpd) overflow for message id in the snmp header. ok? Index: snmpclient.c === RCS file: /cvs/src/usr.sbin/snmpctl/snmpclient.c,v retrieving revision 1.16 diff -u -p -r1.16 snmpclient.c --- snmpclient.c8

Re: Remove unused variable in usr.bin/openssl/apps.c

2018-08-16 Thread Rob Pierce
On Thu, Aug 16, 2018 at 06:14:06PM +0800, Nan Xiao wrote: > Hi tech@, > > The `free_out' variable seems redundant, so this patch removes it: > > Index: apps.c > === > RCS file: /cvs/src/usr.bin/openssl/apps.c,v > retrieving revision

remove some end-of-content code from ber api

2018-08-12 Thread Rob Pierce
As per X.690, "the end-of-contents octets shall be present if the length is encoded as specified in 8.1.3.6, otherwise they shall not be present", i.e. only used with indefinite length encoding. Since we do not support indefinite length encoding, I thought it may make sense to remove some

change ber_write_elements to return ssize_t

2018-08-11 Thread Rob Pierce
In aldap.c, tls_write(2) and write(2) also return ssize_t, so both error and wrote have been changed accordingly. ok? Index: usr.bin/ldap/aldap.c === RCS file: /cvs/src/usr.bin/ldap/aldap.c,v retrieving revision 1.4 diff -u -p -r1.4

cleanup defunct prototype in snmpe.c

2018-07-23 Thread Rob Pierce
It looks like some code was shuffled around in revision 1.34 in which snmpe_application was renamed to smi_application and this prototype was missed. ok? Index: snmpe.c === RCS file: /cvs/src/usr.sbin/snmpd/snmpe.c,v retrieving

Re: xidle: launching program on timeout without active-area

2018-09-04 Thread Rob Pierce
On Tue, Sep 04, 2018 at 01:54:10PM +0200, Claudio Jeker wrote: > On Mon, Sep 03, 2018 at 03:49:46PM +0200, Sebastien Marie wrote: > > ping > > I like it, OK claudio@ but I'm not really a X person. I also like it and it works well for me. ok rob@ with the same caveat. Rob > > On Tue, Aug 14,

Re: call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-07-03 Thread Rob Pierce
On Sat, Jun 30, 2018 at 02:04:16PM -0400, Rob Pierce wrote: > I recently committed a piece of BER code synchronizing in the wrong direction > (i.e. from the ldap instances to the snmpd instance). sthen@ noticed a break > in SNMPv3 authentication and reverted that part of the change. Than

Re: update ifstated parser

2018-03-05 Thread Rob Pierce
On Mon, Feb 26, 2018 at 05:10:43PM -0600, Michael Graves wrote: > Hello > > I use ifstated(8) to track the state of the the external interface that is > configured via dhcp and based upon the state, (re)configure a VXLAN > interface. > The ifstated.conf currently looks like > > === > exif="em0"

use __func__ in iked util.c log_debug

2018-06-22 Thread Rob Pierce
ok? Index: util.c === RCS file: /cvs/src/sbin/iked/util.c,v retrieving revision 1.35 diff -u -p -r1.35 util.c --- util.c 13 Dec 2017 08:27:06 - 1.35 +++ util.c 22 Jun 2018 12:52:09 - @@ -703,7 +703,7 @@

<    1   2