Fix possible exit race in the parser
Call pthread_cond_broadcast() on exit with its mutex held to ensure
that the receiving threads are all either parked or running and then
checking quit before calling pthread_cond_wait().
Also once woken recheck the value of quit and exit the main loop early.
OK tb@
DNS names are not proper C strings, they can contain NUL octets.
If we want to use string functions (e.g. for comparison) we first need
to convert them.
with dgl some time ago
OK dlg
Rework the IdleHoldTimer and how fast reconnects are implemented.
On first error bgpd should allow a fast reconnect - this is especially
helpful for passive sessions. The way this was implemented was error
prone with a special case in session_accept().
Adjust the FSM so that on the first IDLE transistion the session uses
a IdleHoldTime of 0 sec but then increased to INTERVAL_IDLE_HOLD_INITIAL.
At the same time the outgoing connection is delatyed via ConnectRetryTimer.
Doing this moves the session quickly into active state and allows new
connections in but delays the reconnect like before.
Additionally the STATE_ACTIVE / EVNT_START FSM case is adjusted to initiate
a connect immediatly. This allows a 'bgpctl nei X up' to work also for
sessions in ACTIVE state. Also passive sessions will initiate a connection
in this case, which is a new behaviour.
OK tb@
Use peer_dump_done() in the EXPORT_NONE and EXPORT_DEFAULT_ROUTE cases of
peer_dump().
peer_dump_done() calls peer_blast_done() and it issues the End-Of-RIB
marker. This unifies all the peer_dump finalizers to use peer_dump_done().
OK tb@
Switch a few uint32_t to unsigned int where it makes sense.
Instead of mixing uint32_t with unsigned long long use unsigned int for
those. In most cases those are simple counts that can't get too big.
The same is the case for max_prefix and max_out_prefix. There is no good
reason to use uint32_t there.
OK tb@
Don't use SCSI_DATA_IN for patrol read commands that don't have a data
buffer. Noticed while looking into crashes reported by job@ but doesn't
fix anything.
ok dlg@
relayd: add ECDSA support to the CA privsep engine
Add an EC_KEY_METHOD that forwards the sign operation to the CA process,
clone the existing RSA engine. ssl_load_pkey() now handles both RSA
and EC keys and attaches the cert hash accordingly.
The engine and signing code was migrated from smtpd from (op@) with
some tweaks by me.
OK op@
vmd(8): validate memory ranges in vmd before vmm(4).
While vmm(4) does its own check on the number of memory ranges, do
the check in vmd(8) to fail fast and provide feedback to the user.
Report and diff by Andrew Griffiths.
ok @hshoexer
authpf(8) read_config() should chop off trailing white space
if administrator mistakenly types into configuration file
anchor=authpf_test
where 'authpf_test' is followed by white space, the authpf(8)
is going to use anchor 'authpf_test ' instead of the 'authpf_test'
which is defined in pf.conf(5) as 'anchor authpf_test/*'
issue kindly reported and patch submitted by
Avinash Duduskar <avinash.duduskar (_at_) gmail (_dot_) com>
OK sashan@
Bring back up_generate_addpath_all() using the rib entry queue
add-path send all can take a fair amount of shortcuts compared to the
other add-path send modes. The rib entry queue (struct pq_entry) holds
all the information to update the adj-rib-out.
For general updates just walk the pq list and insert / withdraw all
paths. A path can only be once on the list so the code just needs to
walk it and call up_process_prefix for updates. If up_process_prefix()
returns UP_FILTERED or UP_EXCLUDED then try to withdraw the prefix. This
uses the same codepath as for any withdraw in the queue.
Tested on the NLNOG ring looking glass server.
OK tb@
Document how unveil(2) permissions correspond to various pledge(2) promises.
unveil considers the operation that happens at namei(9) time, but pledge has a
deeper integration into subsystems, therefore pledge can be more precise.
This change is the result of various experiments. For example the "unix" promise
allows creating files when calling bind(2) on an AF_UNIX socket, we found
requiring the "cpath" promise along with "unix" either required extensive
changes or made the promise set too broad. Similiar applies to connect(2) and
"wpath". Instead document that the unveil permissions "c", "w" and "r"
correspond to a larger set of pledge promises.
ok deraadt