openbsd
2 years agoRevert previous commit. The problem it was attempting to fix was already
dtucker [Fri, 11 Mar 2022 09:04:59 +0000 (09:04 +0000)]
Revert previous commit.  The problem it was attempting to fix was already
fixed by tb@ in rev 1.20.  Spotted by tb@

2 years agoregen
jsg [Fri, 11 Mar 2022 08:29:21 +0000 (08:29 +0000)]
regen

2 years agofix previous
jsg [Fri, 11 Mar 2022 08:28:40 +0000 (08:28 +0000)]
fix previous

2 years agoCheck for underflow as well as overflow when scaling negative numbers.
dtucker [Fri, 11 Mar 2022 07:29:53 +0000 (07:29 +0000)]
Check for underflow as well as overflow when scaling negative numbers.
ok millert@

2 years agoEnable PL011 UART FIF0 support in pluart(4). The FIFO depth depends on
anton [Fri, 11 Mar 2022 06:45:22 +0000 (06:45 +0000)]
Enable PL011 UART FIF0 support in pluart(4). The FIFO depth depends on
the revision and ranges from 16 to 32 bytes.

Special treatment of Server Base System Architecture (SBSA) generic UART
devices is required as presence of the interrupt trigger level register
is not guaranteed. Therefore treat such devices of having a 1-byte FIFO.

With help from kettenis@ and ok visa@

2 years agoDowngrade RISCV ABI mismatch error to a warning
jca [Thu, 10 Mar 2022 23:24:30 +0000 (23:24 +0000)]
Downgrade RISCV ABI mismatch error to a warning

This lets lld link code with object files created with ld -b binary,
as used by several ports (mupdf, postgresql-pllua, various games).
Upstream report with an unfinished diff: https://reviews.llvm.org/D106378

ok kettenis@

2 years agoKASSERT should not contain memory barriers as they change behavior.
bluhm [Thu, 10 Mar 2022 21:00:51 +0000 (21:00 +0000)]
KASSERT should not contain memory barriers as they change behavior.
Read the integer values without atomic operations.
OK kettenis@

2 years agoUse atomic load and store functions to access refcnt and wait
bluhm [Thu, 10 Mar 2022 15:21:08 +0000 (15:21 +0000)]
Use atomic load and store functions to access refcnt and wait
variables.  Although not necessary everywhere, using atomic functions
exclusively for variables marked as atomic is clearer.
OK mvs@ visa@

2 years agoForgot makefile for atomic_load_int.9 in previous commit.
bluhm [Thu, 10 Mar 2022 15:19:01 +0000 (15:19 +0000)]
Forgot makefile for atomic_load_int.9 in previous commit.

2 years agoProvide atomic load and store functions for int and long. FreeBSD
bluhm [Thu, 10 Mar 2022 14:12:40 +0000 (14:12 +0000)]
Provide atomic load and store functions for int and long.  FreeBSD
also uses these names.  This implements a complete interface for
atomic operations, such functions can be used for every access.
They provide compiler barriers, but no CPU memory barriers.  This
is consistent with our other atomic operations.
OK mvs@ visa@

2 years agoInvalidate the nic's rx descriptor cache when taking the interface up
jmatthew [Thu, 10 Mar 2022 11:35:13 +0000 (11:35 +0000)]
Invalidate the nic's rx descriptor cache when taking the interface up
or down, and turn off the global tx and rx enables when going down.
Without this, the nic can write to mbufs that were taken off the ring
when the interface was taken down, triggering mbuf cluster pool use
after free checks.

ok dlg@

2 years agoDo not clear the PG_BUSY flag before passing the anon to uvm_anon_release().
mpi [Thu, 10 Mar 2022 10:46:56 +0000 (10:46 +0000)]
Do not clear the PG_BUSY flag before passing the anon to uvm_anon_release().

Should prevent a KASSERT() from tiggering when freeing an anon after swaping-out
its memory.

This code path has been broken since at least January 2021 and is apparently not
so easy to trigger.

Found the hard way by sthen@

ok kettenis@, kn@

2 years agoAdd support for Sunrisepoint-H and Sunrisepoint-LP platforms.
hastings [Thu, 10 Mar 2022 10:30:10 +0000 (10:30 +0000)]
Add support for Sunrisepoint-H and Sunrisepoint-LP platforms.

Also mask unhandled interrupts like we do in amdgpio(4).

ok kettenis@, deraadt@

2 years agoAdd mtw(4) to fw_update(8).
hastings [Thu, 10 Mar 2022 07:18:24 +0000 (07:18 +0000)]
Add mtw(4) to fw_update(8).

ok jsg@

2 years agoInform fw_update(8) about mtw(4) pattern.
hastings [Thu, 10 Mar 2022 07:12:13 +0000 (07:12 +0000)]
Inform fw_update(8) about mtw(4) pattern.

ok jsg@

2 years agoSimple regress for NULL deref reported by Guido Vranken and fixed in
tb [Thu, 10 Mar 2022 04:39:49 +0000 (04:39 +0000)]
Simple regress for NULL deref reported by Guido Vranken and fixed in
bn_exp2.c r1.13.

2 years agoauthentcation -> authentication
jsg [Thu, 10 Mar 2022 03:09:55 +0000 (03:09 +0000)]
authentcation -> authentication

2 years agotansformed -> transformed
jsg [Thu, 10 Mar 2022 01:56:02 +0000 (01:56 +0000)]
tansformed -> transformed

2 years agoimmediatly -> immediately
jsg [Thu, 10 Mar 2022 01:45:30 +0000 (01:45 +0000)]
immediatly -> immediately

2 years agoverion -> version
jsg [Thu, 10 Mar 2022 01:39:55 +0000 (01:39 +0000)]
verion -> version

2 years agounsusual -> unusual
jsg [Thu, 10 Mar 2022 00:55:50 +0000 (00:55 +0000)]
unsusual -> unusual

2 years agospelling/wording
jsg [Wed, 9 Mar 2022 22:39:12 +0000 (22:39 +0000)]
spelling/wording
ok afresh1@

2 years agoUpdate libexpat to 2.4.7. Relevant for OpenBSD are bug fixes #572
bluhm [Wed, 9 Mar 2022 19:22:19 +0000 (19:22 +0000)]
Update libexpat to 2.4.7.  Relevant for OpenBSD are bug fixes #572
#577 and other changes #577 #579 #575 #574 #569 #571.  No library
bump necessary.
tested and OK tb@

2 years agoChange the logic around rounding up the needed memory for sysctls since
claudio [Wed, 9 Mar 2022 17:29:52 +0000 (17:29 +0000)]
Change the logic around rounding up the needed memory for sysctls since
the network state can change between the two sysctl calls. Adding 10%
extra works for larger routing tables but can be too little on smaller
tables to hold even a single extra message. Instead of that add at least
1024 bytes or 10% (whichever is bigger) and round the size up to the next
page. With this there are no more sporadic errors in the bgpd integration
tests.
OK sthen@

2 years agobandwith -> bandwidth
jsg [Wed, 9 Mar 2022 13:50:41 +0000 (13:50 +0000)]
bandwith -> bandwidth

2 years agofix a minor bug that's going to become more relevant: mark cwds as
espie [Wed, 9 Mar 2022 12:27:51 +0000 (12:27 +0000)]
fix a minor bug that's going to become more relevant: mark cwds as
"already" extracted like meta information, so that they end in partial
packages

2 years agoIdenfitier -> Identifier
jsg [Wed, 9 Mar 2022 12:19:25 +0000 (12:19 +0000)]
Idenfitier -> Identifier

2 years agoImprove stability of roaming on iwn(4), in particular with wpa_supplicant.
stsp [Wed, 9 Mar 2022 11:38:51 +0000 (11:38 +0000)]
Improve stability of roaming on iwn(4), in particular with wpa_supplicant.

Clear HT-related rxon flags in firmware when switching away from RUN
or ASSOC state. This avoids fatal firmware errors.

When starting a scan, set link state down and clear ic_bss before
sending the scan command to the device, not after.

tested by mbuhl@ on eduroam
ok mbuhl@

2 years agoArm is not ready for unwinding yet. Disable unwind info generation for now.
mortimer [Wed, 9 Mar 2022 00:09:45 +0000 (00:09 +0000)]
Arm is not ready for unwinding yet. Disable unwind info generation for now.

ok deraadt@

2 years agoIn IPsec policy replace integer refcount with atomic refcount.
bluhm [Tue, 8 Mar 2022 22:30:38 +0000 (22:30 +0000)]
In IPsec policy replace integer refcount with atomic refcount.
OK tobhe@ mvs@

2 years agoWith -f use percentages of window size not pane size, GitHub issue 2866.
nicm [Tue, 8 Mar 2022 22:14:25 +0000 (22:14 +0000)]
With -f use percentages of window size not pane size, GitHub issue 2866.

2 years agoFix user hooks (which are strings not arrays).
nicm [Tue, 8 Mar 2022 21:58:37 +0000 (21:58 +0000)]
Fix user hooks (which are strings not arrays).

2 years agomerge iack_mtx, upd_c_mtx, del_mtx, ins_mtx and upd_mtx mutexes into single
sashan [Tue, 8 Mar 2022 20:46:01 +0000 (20:46 +0000)]
merge iack_mtx, upd_c_mtx, del_mtx, ins_mtx and upd_mtx mutexes into single
mutex st_mtx. This simplifies pf(4) state handling in pfsync(4). It also
makes it more reliable.

OK bluhm@

2 years agoalso use the device name in ucc_intr() debug output
anton [Tue, 8 Mar 2022 19:32:41 +0000 (19:32 +0000)]
also use the device name in ucc_intr() debug output

2 years agoAdd remain-on-exit-format to set text shown when pane is dead.
nicm [Tue, 8 Mar 2022 18:31:46 +0000 (18:31 +0000)]
Add remain-on-exit-format to set text shown when pane is dead.

2 years agoAdd a sleep when starting the bgpd daemons so that there is less chance
claudio [Tue, 8 Mar 2022 17:20:52 +0000 (17:20 +0000)]
Add a sleep when starting the bgpd daemons so that there is less chance
for a connection collision.

2 years agoSome more c99 initializers for consistency and readability
tb [Tue, 8 Mar 2022 16:59:25 +0000 (16:59 +0000)]
Some more c99 initializers for consistency and readability

2 years agoMake cad(4) handle rxr ioctl.
visa [Tue, 8 Mar 2022 16:13:08 +0000 (16:13 +0000)]
Make cad(4) handle rxr ioctl.

2 years agoEnable mtw(4) in the build for amd64.
hastings [Tue, 8 Mar 2022 15:08:01 +0000 (15:08 +0000)]
Enable mtw(4) in the build for amd64.

Firmware is available via fw_update(8).

ok stsp@

2 years agoAvoid leak of roa in rtr_parse_ipv{4,6}_prefix()
tb [Tue, 8 Mar 2022 13:02:42 +0000 (13:02 +0000)]
Avoid leak of roa in rtr_parse_ipv{4,6}_prefix()

If the length checks trigger, roa is leaked. Pull the length checks
above the allocation, which makes more sense and avoids additional
free(roa).

ok claudio

2 years agoNo need to print fetchtable twice in this error message.
claudio [Tue, 8 Mar 2022 12:58:57 +0000 (12:58 +0000)]
No need to print fetchtable twice in this error message.

2 years agouse the device name in debug output
anton [Tue, 8 Mar 2022 12:47:33 +0000 (12:47 +0000)]
use the device name in debug output

2 years agoAdd argument to refresh-client -l to forward clipboard to a pane. GitHub
nicm [Tue, 8 Mar 2022 12:01:19 +0000 (12:01 +0000)]
Add argument to refresh-client -l to forward clipboard to a pane. GitHub
issue 3068.

2 years agoAdd formats for client and server UID and user (for multiuser setups).
nicm [Tue, 8 Mar 2022 11:28:40 +0000 (11:28 +0000)]
Add formats for client and server UID and user (for multiuser setups).

2 years agoStart bgpd in rdomain 1 a bit earlier to avoid session establishment
claudio [Tue, 8 Mar 2022 07:50:34 +0000 (07:50 +0000)]
Start bgpd in rdomain 1 a bit earlier to avoid session establishment
conflicts.

2 years agoHandle rxrinfo ioctl.
jmatthew [Tue, 8 Mar 2022 06:56:14 +0000 (06:56 +0000)]
Handle rxrinfo ioctl.

ok dlg@

2 years agoAdd missing byteswap to mtw_write_cfg().
hastings [Tue, 8 Mar 2022 06:05:58 +0000 (06:05 +0000)]
Add missing byteswap to mtw_write_cfg().
Fixes loading firmware on big-endian machines.

ok stsp@, jmatthew@

2 years agosync
deraadt [Tue, 8 Mar 2022 04:03:19 +0000 (04:03 +0000)]
sync

2 years agoremove files used by isa radio drivers removed in 2016
jsg [Tue, 8 Mar 2022 00:13:19 +0000 (00:13 +0000)]
remove files used by isa radio drivers removed in 2016

lm700x: az, rt
tc921x: sfr
pt2254a: sfr, sf2r

2 years agoremove WD33C93 SCSI code
jsg [Mon, 7 Mar 2022 23:40:53 +0000 (23:40 +0000)]
remove WD33C93 SCSI code
used by wdsc on sgi (removed in 2021)
ok krw@

2 years agogrow diskspace
deraadt [Mon, 7 Mar 2022 21:43:00 +0000 (21:43 +0000)]
grow diskspace

2 years agovio(4): use NULL instead of 0 with sc_{rx,tx}_mbuf pointer array.
dv [Mon, 7 Mar 2022 18:52:16 +0000 (18:52 +0000)]
vio(4): use NULL instead of 0 with sc_{rx,tx}_mbuf pointer array.

ok millert@, deraadt@

2 years agoResolve clang unused-but-set warnings in vmd's vioscsi.c.
dv [Mon, 7 Mar 2022 14:17:47 +0000 (14:17 +0000)]
Resolve clang unused-but-set warnings in vmd's vioscsi.c.

A few of the vioscsi functions have debug logging in DPRINTF's and
are the only use of some declared variables. This tucks any debug-only
variables into the DPRINTF or behind an #if DEBUG.

ok from deraadt@ caveated I don't add code before any declarations.

2 years agoPrevent deadlock in cad_down()
visa [Mon, 7 Mar 2022 13:02:53 +0000 (13:02 +0000)]
Prevent deadlock in cad_down()

Introduce an rwlock to serialize cad(4) ioctl operations so that
cad_down() can release NET_LOCK() temporarily when invoking barriers.
This releasing prevents a possible deadlock with the taskq barrier.
The deadlock was pointed out by witness(4).

In addition, release NET_LOCK() when allocating memory in cad_up()
to reduce the risk of ill effects.

2 years agoPass client when adding menu item, GitHub issue 3103.
nicm [Mon, 7 Mar 2022 11:52:09 +0000 (11:52 +0000)]
Pass client when adding menu item, GitHub issue 3103.

2 years agoSince AIC2 uses 4 interrupt cells we need to adjust the code that handles
kettenis [Mon, 7 Mar 2022 11:08:13 +0000 (11:08 +0000)]
Since AIC2 uses 4 interrupt cells we need to adjust the code that handles
the "msi-ranges" property and converts it into a proper interrupt descriptor
for MSIs.

ok jsg@

2 years agoSwitch internal sample representation to 24-bit fixed-point
ratchov [Mon, 7 Mar 2022 09:04:45 +0000 (09:04 +0000)]
Switch internal sample representation to 24-bit fixed-point

Note that this also changes the default file encoding to 24-bit.

2 years agoSwitch internal sample representation to 24-bit fixed-point.
ratchov [Mon, 7 Mar 2022 08:58:33 +0000 (08:58 +0000)]
Switch internal sample representation to 24-bit fixed-point.

The default device precision doesn't change (yet), i.e. we still
request the usual 16-bit mode, when available. Hardware supporting
24-bit samples only gets end-to-end 24-bit processing by default.

ok kettenis

2 years agorename net80211 ioctl struct ieee80211_channel to struct ieee80211_chaninfo
stsp [Mon, 7 Mar 2022 08:13:13 +0000 (08:13 +0000)]
rename net80211 ioctl struct ieee80211_channel to struct ieee80211_chaninfo

ioctls should use dedicated names for their structs, but SIOCG80211ALLCHANS
duplicated struct ieee80211_channel. We cannot make changes to the kernel's
version of ieee80211_channel while an ioctl is squatting on the struct name.

Helpful guidance from deraadt@
Tested in a ports bulk build by sthen@, and tested by Mikhail.

ok sthen@

2 years agobump for LibreSSL 3.5.1
bcook [Mon, 7 Mar 2022 04:11:24 +0000 (04:11 +0000)]
bump for LibreSSL 3.5.1

2 years agoAdd JMICRON JMB58x ahci
chrisz [Sun, 6 Mar 2022 22:08:51 +0000 (22:08 +0000)]
Add JMICRON JMB58x ahci

ok dlg@

2 years agoSimple move firmware subdirectory in place as suggested by deraadt@
kettenis [Sun, 6 Mar 2022 19:35:22 +0000 (19:35 +0000)]
Simple move firmware subdirectory in place as suggested by deraadt@
Improved chicken scratches from tb@

2 years agoFetch bwfm(4) firmware from the EFI System Partition on Apple Silicon
kettenis [Sun, 6 Mar 2022 19:09:29 +0000 (19:09 +0000)]
Fetch bwfm(4) firmware from the EFI System Partition on Apple Silicon
devices and copy it into the right directory on the ramdisk such that it
can be used in the installer.  And copy it in place at the end of the
install procedure such that it is available for use in the newly installed
system.

ok deraadt@

2 years agoLook for firmware for Apple Silicon devices in /etc/firmware/apple-bwfm.
kettenis [Sun, 6 Mar 2022 18:52:47 +0000 (18:52 +0000)]
Look for firmware for Apple Silicon devices in /etc/firmware/apple-bwfm.

ok deraadt@

2 years agoUsually we check ipsec_in_use as shortcut to avoid IPsec lookups,
bluhm [Sun, 6 Mar 2022 15:24:50 +0000 (15:24 +0000)]
Usually we check ipsec_in_use as shortcut to avoid IPsec lookups,
but that does not work when coming from tcp_output() as inp != NULL.
This seems to be done to block packets from sockets with options
in inp_seclevel.  But instead of doing the route lookup, go directly
to ipsp_spd_inp() where the socket policy checks are done.  Calling
rtable_l2() before the shortcut also costs a bit, do it when needed.
OK tobhe@

2 years agooops, typo, spotted by Mikhail
deraadt [Sun, 6 Mar 2022 15:12:00 +0000 (15:12 +0000)]
oops, typo, spotted by Mikhail

2 years agoConvert KVA allocation to km_alloc(9).
kettenis [Sun, 6 Mar 2022 12:16:27 +0000 (12:16 +0000)]
Convert KVA allocation to km_alloc(9).

ok mpi@

2 years agoremove unused usbdev and btbus attributes
jsg [Sun, 6 Mar 2022 08:40:34 +0000 (08:40 +0000)]
remove unused usbdev and btbus attributes

2 years agoAdd an activate() function with DVACT_QUIESCE & DVACT_RESUME hooks
deraadt [Sat, 5 Mar 2022 17:00:14 +0000 (17:00 +0000)]
Add an activate() function with DVACT_QUIESCE & DVACT_RESUME hooks
(this has succesfully unhibernated a server machine)
ok dlg

2 years agoImprove wording for trying S5 instead of S4
deraadt [Sat, 5 Mar 2022 16:58:35 +0000 (16:58 +0000)]
Improve wording for trying S5 instead of S4

2 years agoAdd test coverage for i2a_ASN1_OBJECT()
jsing [Sat, 5 Mar 2022 14:16:13 +0000 (14:16 +0000)]
Add test coverage for i2a_ASN1_OBJECT()

2 years agoMove initial ROM console related codes into separated luna88k/romcons.c
aoyama [Sat, 5 Mar 2022 11:03:30 +0000 (11:03 +0000)]
Move initial ROM console related codes into separated luna88k/romcons.c
file.

No functional change, tested by me.

2 years ago#if INET6 -> #ifdef INET6 to be consistent
jsg [Sat, 5 Mar 2022 10:43:32 +0000 (10:43 +0000)]
#if INET6 -> #ifdef INET6 to be consistent

2 years agoremove fddi leftover
jsg [Sat, 5 Mar 2022 09:50:49 +0000 (09:50 +0000)]
remove fddi leftover
no binary change

2 years agoFix typo in comment
bket [Sat, 5 Mar 2022 07:13:48 +0000 (07:13 +0000)]
Fix typo in comment

OK tb@

2 years agoMove CPU-CMMU association report into #ifdef DEBUG section.
aoyama [Sat, 5 Mar 2022 06:59:12 +0000 (06:59 +0000)]
Move CPU-CMMU association report into #ifdef DEBUG section.

This was useful in early days of porting OpenBSD to LUNA-88K, but now
more detailed information is shown in dmesg.

Tested by me.

2 years agoPut back local patch to avoid regenerating tests
afresh1 [Fri, 4 Mar 2022 22:53:05 +0000 (22:53 +0000)]
Put back local patch to avoid regenerating tests

This was r1.2 and accidentally lost in the update to Devel::PPPort 3.64.

2 years agoAdd support for the BCM4387. The firmware for this variant uses a new scan
kettenis [Fri, 4 Mar 2022 22:34:41 +0000 (22:34 +0000)]
Add support for the BCM4387.  The firmware for this variant uses a new scan
command, which is indicated by the "scan_ver" firmware variable.

ok patrick@

2 years agoin_addmulti() is only called from ioctl(2) or setsockopt(2). Wait
bluhm [Fri, 4 Mar 2022 21:09:03 +0000 (21:09 +0000)]
in_addmulti() is only called from ioctl(2) or setsockopt(2).  Wait
for malloc(9) to make the system call reliable.
OK mvs@

2 years agoin_pcbinit() is called during boot. There malloc(9) cannot fail,
bluhm [Fri, 4 Mar 2022 20:35:10 +0000 (20:35 +0000)]
in_pcbinit() is called during boot.  There malloc(9) cannot fail,
but would panic instead of waiting.  Remove needless error handling.
OK mvs@

2 years agofix year, from mikhail
deraadt [Fri, 4 Mar 2022 18:14:20 +0000 (18:14 +0000)]
fix year, from mikhail

2 years agoReport versioned lib.so in cc --print-file-name given short name
gnezdo [Fri, 4 Mar 2022 16:46:23 +0000 (16:46 +0000)]
Report versioned lib.so in cc --print-file-name given short name

E.g. `cc --print-file-name libc.so` reports /usr/lib/libc.so.96.1

This is a complement of the major.minor finding logic in DriverUtils.
`ld -lc -L/usr/lib` currently find the libraries with this logic.

To make things more obviously related the code was extracted into a
function which was copied over verbatim.

fine with mortimer@
ok patrick@

2 years agoMake the regress test more reliable by starting the bgpd instances further
claudio [Fri, 4 Mar 2022 11:01:15 +0000 (11:01 +0000)]
Make the regress test more reliable by starting the bgpd instances further
apart from each other. bgpd's connection collision avoidance is not optimal
and in that case the regress test timeous out before the session is up.

2 years agoDocument LOGIN_SETRTABLE
tb [Fri, 4 Mar 2022 08:47:53 +0000 (08:47 +0000)]
Document LOGIN_SETRTABLE

ok deraadt millert tedu

2 years agoRevert previous and add LOGIN_SETENV and LOGIN_SETRTABLE
tb [Fri, 4 Mar 2022 05:37:21 +0000 (05:37 +0000)]
Revert previous and add LOGIN_SETENV and LOGIN_SETRTABLE

Instead of only adding LOGIN_SETENV and LOGIN_SETRTABLE, LOGIN_SETALL
also includes LOGIN_SETLOGIN, which had the unintended side effect of
breaking logname(1).

ok deraadt tedu

2 years agoOnly provide the .gz file if timestamp is >= the non-gzip file. Make
deraadt [Fri, 4 Mar 2022 01:46:07 +0000 (01:46 +0000)]
Only provide the .gz file if timestamp is >= the non-gzip file.  Make
sure it is a regular file.  Use the timestamp of the non-gzip file as
the last-modified timestamp, as proposed by claudio.
ok claudio bluhm millert

2 years agor1.241 was the culprit. Unrevert r1.240.
krw [Thu, 3 Mar 2022 19:10:13 +0000 (19:10 +0000)]
r1.241 was the culprit. Unrevert r1.240.

2 years agoUse LDNS_RCODE define; no functional change
florian [Thu, 3 Mar 2022 18:54:07 +0000 (18:54 +0000)]
Use LDNS_RCODE define; no functional change

2 years agoRevert r1.241 and r1.240 which may have broken softraid.
krw [Thu, 3 Mar 2022 16:52:07 +0000 (16:52 +0000)]
Revert r1.241 and r1.240 which may have broken softraid.

2 years agoStub rde_send_kroute() reminded by tb@
claudio [Thu, 3 Mar 2022 13:10:53 +0000 (13:10 +0000)]
Stub rde_send_kroute() reminded by tb@

2 years agoMove rde_send_kroute() from rde_generate_updates() to prefix_evaluate().
claudio [Thu, 3 Mar 2022 13:06:15 +0000 (13:06 +0000)]
Move rde_send_kroute() from rde_generate_updates() to prefix_evaluate().
rde_generate_updates() should only handle RIB updates and the logic
for rde_send_kroute() may change in the future.
Refactor code to simplify it a bit and make it clear that to delete a
prefix from the FIB only the prefix/len is needed.
OK tb@

2 years agoPull a len == 0 check up before malloc(len) to avoid implementation
tb [Thu, 3 Mar 2022 11:29:05 +0000 (11:29 +0000)]
Pull a len == 0 check up before malloc(len) to avoid implementation
defined behavior.

ok deraadt inoguchi

2 years agoRemove the labelid from struct kroute_full. It was never really used.
claudio [Thu, 3 Mar 2022 11:19:41 +0000 (11:19 +0000)]
Remove the labelid from struct kroute_full. It was never really used.
The label is passed as a string in kroute_full.
Ok tb@

2 years agoPick correct firmware directory. Read the target kernel version and use
sdk [Thu, 3 Mar 2022 10:12:08 +0000 (10:12 +0000)]
Pick correct firmware directory. Read the target kernel version and use
the release directory for everything except -current.

OK afresh1@

2 years agoAllow optional arguments.
nicm [Thu, 3 Mar 2022 08:24:12 +0000 (08:24 +0000)]
Allow optional arguments.

2 years agoDo not write out terminating NUL in i2a_ASN1_OBJECT()
tb [Thu, 3 Mar 2022 08:06:57 +0000 (08:06 +0000)]
Do not write out terminating NUL in i2a_ASN1_OBJECT()

The conversion to CBB made us write out an extra NUL since we no longer
use the return value of i2t_ASN1_OBJECT() (which returns strlen(data))
but rather the size of the CBB (which includes a terminal NUL) to write
out data.

Issue found by anton via an openssl-ruby test failure.

ok jsing

2 years agostruct stat from early file inspection was being used after actual file
deraadt [Wed, 2 Mar 2022 23:27:43 +0000 (23:27 +0000)]
struct stat from early file inspection was being used after actual file
open() which means the stat could refer to the wrong file.  Mostly this
relates to st_size use.  This bug could mean that httpd sends new files
truncated to the old length, saying "I am sure you have the correct file now"?
Could have other bad effects.
ok tb millert bluhm

2 years agoUse NULL instead of 0 for pointer.
bluhm [Wed, 2 Mar 2022 21:30:58 +0000 (21:30 +0000)]
Use NULL instead of 0 for pointer.

2 years agoMerge two comments describing the locks into one.
bluhm [Wed, 2 Mar 2022 20:16:43 +0000 (20:16 +0000)]
Merge two comments describing the locks into one.

2 years agoSimplify .gz handling a bit
tb [Wed, 2 Mar 2022 19:52:19 +0000 (19:52 +0000)]
Simplify .gz handling a bit

Combine strlcpy + strlcat into a single snprintf and remove a few
unnecessary parentheses.

ok deraadt millert