openbsd
3 years agoThe ktrace record for recvmsg/recvfrom could contain extract bits in
deraadt [Wed, 10 Mar 2021 17:03:58 +0000 (17:03 +0000)]
The ktrace record for recvmsg/recvfrom could contain extract bits in
msg_flags (they get set internally).  Correct the record to only contain
what the caller requested.

3 years agocleanup the 3 ways (2 for ipv4, 1 for ipv6) of doing dynamic address
deraadt [Wed, 10 Mar 2021 17:00:16 +0000 (17:00 +0000)]
cleanup the 3 ways (2 for ipv4, 1 for ipv6) of doing dynamic address
allocation. not the perfect text yet, but it is better.
discussed with florian and jmc

3 years agoLet MAIR comment catch up with reality.
kettenis [Wed, 10 Mar 2021 15:56:06 +0000 (15:56 +0000)]
Let MAIR comment catch up with reality.

3 years agoFix typo for ATS attribute member in IORT root complex struct.
patrick [Wed, 10 Mar 2021 12:49:24 +0000 (12:49 +0000)]
Fix typo for ATS attribute member in IORT root complex struct.

3 years agoExpand the maximum length for CHAP challenge to 96 octets. npppd
yasuoka [Wed, 10 Mar 2021 10:51:10 +0000 (10:51 +0000)]
Expand the maximum length for CHAP challenge to 96 octets.  npppd
couldn't handle ICCN message which has a ProxyAuthenChallenge AVP
longer than 24 octets.  Juniper actually send such challenges.
Reported and tested by Ryan Freeman.

3 years agoFix "phone number" spelling.
patrick [Wed, 10 Mar 2021 10:29:26 +0000 (10:29 +0000)]
Fix "phone number" spelling.

ok yasuoka@

3 years agospelling
jsg [Wed, 10 Mar 2021 10:21:47 +0000 (10:21 +0000)]
spelling

ok gnezdo@ semarie@ mpi@

3 years agosndiod: When a slot structure is recycled allocate new control
ratchov [Wed, 10 Mar 2021 08:22:25 +0000 (08:22 +0000)]
sndiod: When a slot structure is recycled allocate new control

Trying to rename the program level control is not needed anymore.
When a slot is given to another program, the new ctl_{new,del}()
functions can be used to delete the control of the old program and
create a new one for the new program. Cleaner, simpler.

3 years agosndiod: Style tweak: swap if/else code blocks in slot_new()
ratchov [Wed, 10 Mar 2021 08:21:27 +0000 (08:21 +0000)]
sndiod: Style tweak: swap if/else code blocks in slot_new()

3 years agoWhen adding files from the manifest only the .crl need to be first, after
claudio [Wed, 10 Mar 2021 08:09:41 +0000 (08:09 +0000)]
When adding files from the manifest only the .crl need to be first, after
that the order does not matter so simplify the code and just walk the
list twice. Add the .crl first and then in the second round all other files.
OK job@

3 years agopmap_avail_setup() is the only place physmem is calculated, delete a bunch
deraadt [Wed, 10 Mar 2021 07:28:19 +0000 (07:28 +0000)]
pmap_avail_setup() is the only place physmem is calculated, delete a bunch
of code which thinks it could be done elsewhere.
ok kurt

3 years agoImport regenerated moduli file.
dtucker [Wed, 10 Mar 2021 06:32:27 +0000 (06:32 +0000)]
Import regenerated moduli file.

3 years agono need to reset buffer after send_msg() as that is done for us;
djm [Wed, 10 Mar 2021 04:58:45 +0000 (04:58 +0000)]
no need to reset buffer after send_msg() as that is done for us;
patch from Mike Frysinger

3 years agoAlso log transforms on IKE SA rekey.
tobhe [Tue, 9 Mar 2021 22:51:28 +0000 (22:51 +0000)]
Also log transforms on IKE SA rekey.

3 years agoNode without a "status" property should be considered enabled as well.
kettenis [Tue, 9 Mar 2021 21:11:24 +0000 (21:11 +0000)]
Node without a "status" property should be considered enabled as well.

ok patrick@

3 years agoIssuing FIOSETOWN and TIOCSPGRP ioctl commands on a tun(4) device leaks
anton [Tue, 9 Mar 2021 20:05:14 +0000 (20:05 +0000)]
Issuing FIOSETOWN and TIOCSPGRP ioctl commands on a tun(4) device leaks
device references causing a hang while trying to remove the same
interface since the reference count will never reach zero. Instead of
returning, break out of the switch in order to ensure that tun_put()
gets called.

ok deraadt@ mvs@

Reported-by: syzbot+2ca11c73711a1d0b5c6c@syzkaller.appspotmail.com
3 years agoShorten the if_cloners_lock name preventing it from being truncated in
anton [Tue, 9 Mar 2021 20:03:50 +0000 (20:03 +0000)]
Shorten the if_cloners_lock name preventing it from being truncated in
the top(1) wait column.

ok mvs@

3 years agoRecognize Apple Firestorm cores.
kettenis [Tue, 9 Mar 2021 19:43:04 +0000 (19:43 +0000)]
Recognize Apple Firestorm cores.

3 years agoZap stray Xr
kn [Tue, 9 Mar 2021 19:39:20 +0000 (19:39 +0000)]
Zap stray Xr

3 years agoFix TRUNK synopsis alignment
kn [Tue, 9 Mar 2021 19:05:30 +0000 (19:05 +0000)]
Fix TRUNK synopsis alignment

3 years agoRemove documentation for all port modules no longer supported. ok sthen@
tracey [Tue, 9 Mar 2021 19:05:28 +0000 (19:05 +0000)]
Remove documentation for all port modules no longer supported. ok sthen@

3 years agoAdd support for 30-bit color modes.
kettenis [Tue, 9 Mar 2021 19:02:44 +0000 (19:02 +0000)]
Add support for 30-bit color modes.

3 years agoFix some old phrasing on how to set up a trap handler which aren't correct
martijn [Tue, 9 Mar 2021 18:18:55 +0000 (18:18 +0000)]
Fix some old phrasing on how to set up a trap handler which aren't correct
anymore after moving it from its own subprocess to snmpe.

feedback and OK jan@

3 years agoDedicated regress test for snmp(1) instead of semi-relying on snmpd(8)'s
martijn [Tue, 9 Mar 2021 17:38:24 +0000 (17:38 +0000)]
Dedicated regress test for snmp(1) instead of semi-relying on snmpd(8)'s
regress for basic functionality. This regress covers quite a few usecases,
but there's still plenty missing.

feedback and OK bluhm@

3 years agodocument zstd support in EXTRACT_CASES and change from a big code sample
sthen [Tue, 9 Mar 2021 17:11:13 +0000 (17:11 +0000)]
document zstd support in EXTRACT_CASES and change from a big code sample
that isn't directly usable to a shorter table and example of what one might
need to add to EXTRACT_CASES when making a change; ok espie@

3 years agoKernel drops fewer messages in sendsyslog(2), adapt syslogd(8)
bluhm [Tue, 9 Mar 2021 15:16:28 +0000 (15:16 +0000)]
Kernel drops fewer messages in sendsyslog(2), adapt syslogd(8)
tests.  Kernel stashes logs temporarily, test it.  Fix some races
in existing tests.

3 years agoEarly daemons like dhcpleased(8), slaacd(8), unwind(8), resolvd(8)
bluhm [Tue, 9 Mar 2021 15:08:23 +0000 (15:08 +0000)]
Early daemons like dhcpleased(8), slaacd(8), unwind(8), resolvd(8)
are started before syslogd(8).  This resulted in ugly sendsyslog(2)
dropped logs and the real message was lost.
Create a temporary stash for log messages within the kernel.  It
has a limited size of 100 messages, and each message is truncated
to 8192 bytes.  When the stash is exhausted, the well-known dropped
message is generated with a counter.  After syslogd(8) has setup
everything, it sends a debug line through libc to flush the kernel
stash.  Then syslogd receives all messages from the kernel before
the usual logs.
OK deraadt@ visa@

3 years agoReplace time_t startup_time with struct timespec link_timeout.
krw [Tue, 9 Mar 2021 14:32:24 +0000 (14:32 +0000)]
Replace time_t startup_time with struct timespec link_timeout.

Feedback from otto@

3 years agoAdd initial bits for Check Point UTM-1 EDGE N.
visa [Tue, 9 Mar 2021 14:13:33 +0000 (14:13 +0000)]
Add initial bits for Check Point UTM-1 EDGE N.

From Thaison Nguyen

3 years agoAllow cursor to be just after match if copying, GitHub issue 2602.
nicm [Tue, 9 Mar 2021 13:07:50 +0000 (13:07 +0000)]
Allow cursor to be just after match if copying, GitHub issue 2602.

3 years agoCopy mode improvements from Anindya Mukherjee:
nicm [Tue, 9 Mar 2021 08:24:09 +0000 (08:24 +0000)]
Copy mode improvements from Anindya Mukherjee:

- Fix word and word-end for wrapped lines.
- Fix copying of selection end on wrapped lines.
- Fix wrapped word selection edge case.
- Update select-line to respect wrapped lines.
- Update window_copy_..._pos() functions to use grid_reader.

GitHub issue 2605.

3 years agoChange the implementation of the malloc cache to keep lists of
otto [Tue, 9 Mar 2021 07:39:28 +0000 (07:39 +0000)]
Change the implementation of the malloc cache to keep lists of
regions of a given size.  In snaps for a while, committing since
no issues were reported and a wider audience is good.  ok deraadt@

3 years agodhcpleased wants /var (but contains code to handle when it isn't there).
deraadt [Tue, 9 Mar 2021 07:12:15 +0000 (07:12 +0000)]
dhcpleased wants /var (but contains code to handle when it isn't there).
But in the nfs diskless case, we can do better by starting it a little
later.  This disrupts nfs diskless on dynamic addresses a little, if it ever
actually worked with dhclient, but anyone doing that deserves the headache.
ok florian

3 years agoDo not adjust (uhm.. zero) the swap 'b' partition size if physmem is
deraadt [Tue, 9 Mar 2021 07:03:19 +0000 (07:03 +0000)]
Do not adjust (uhm.. zero) the swap 'b' partition size if physmem is
zero (should not happen, but did), because the auto-allocate code will
put a filesystem on that partition.
ok otto kurt

3 years agoofw_read_mem_regions() can skip calculation of physmem. pmap.c
deraadt [Tue, 9 Mar 2021 04:53:40 +0000 (04:53 +0000)]
ofw_read_mem_regions() can skip calculation of physmem.  pmap.c
already calculates _usable_ memory and updates physmem (if it is 0),
whereas ofw_read_mem_regions() was counting usable+unuseable memory.
ie. 4G or more on some machines. powerpc's 32-bit pagetable cannot use memory
beyond 4G phys addr.
(On a 4G machine, physmem64 was calculated as 0, which caused the installer's
auto-diskabel code to place /tmp on the b partition).
ok gkoehler, works for kurt also

3 years agoEnable ixl(4).
patrick [Mon, 8 Mar 2021 20:56:10 +0000 (20:56 +0000)]
Enable ixl(4).

3 years agoStart looking at parsing text to find separators.
lum [Mon, 8 Mar 2021 20:01:43 +0000 (20:01 +0000)]
Start looking at parsing text to find separators.

3 years agoPut regex tests into a function.
lum [Mon, 8 Mar 2021 18:27:33 +0000 (18:27 +0000)]
Put regex tests into a function.

3 years agoRevert commitid: AZrsCSWEYDm7XWuv;
claudio [Mon, 8 Mar 2021 18:09:15 +0000 (18:09 +0000)]
Revert commitid: AZrsCSWEYDm7XWuv;

Kill SINGLE_PTRACE and use SINGLE_SUSPEND which has almost the same semantic.

This diff did not properly kill SINGLE_PTRACE and broke RAMDISK kernels.

3 years agodhclient relationship with "inet autoconf" is incorrect, it activated
deraadt [Mon, 8 Mar 2021 17:39:16 +0000 (17:39 +0000)]
dhclient relationship with "inet autoconf" is incorrect, it activated
dhcpleased.

3 years agoWe no longer "accept" RAs in the kernel, delete misleading comment.
florian [Mon, 8 Mar 2021 16:49:07 +0000 (16:49 +0000)]
We no longer "accept" RAs in the kernel, delete misleading comment.

3 years agoNote that slaacd(8) is enabled by default. Also note that if you
florian [Mon, 8 Mar 2021 16:12:28 +0000 (16:12 +0000)]
Note that slaacd(8) is enabled by default. Also note that if you
disabled it in the past and then note that IPv6 autoconfiguration
doesn't work for you, you will quickly note that we will point and
laugh.

3 years agoAdd another Type Cover device
jcs [Mon, 8 Mar 2021 14:39:34 +0000 (14:39 +0000)]
Add another Type Cover device

from Fredrik Engberg

3 years agoregen
jcs [Mon, 8 Mar 2021 14:37:21 +0000 (14:37 +0000)]
regen

3 years agoAdd Surface Pro Type Cover
jcs [Mon, 8 Mar 2021 14:37:08 +0000 (14:37 +0000)]
Add Surface Pro Type Cover

from Fredrik Engberg

3 years agoAllow uhidev child devices to claim selective report ids
jcs [Mon, 8 Mar 2021 14:35:57 +0000 (14:35 +0000)]
Allow uhidev child devices to claim selective report ids

There may be multiple matching devices on a single uhidev device but
the first device that responds to UHIDEV_CLAIM_ALLREPORTID will
block the others from attaching.

Change this to UHIDEV_CLAIM_MULTIPLE_REPORTID and require any
devices wanting some/all report ids to fill in the claimed array in
uhidev_attach_arg with just the reports it needs.  uhidev can then
run match routines for other drivers with the available report ids.

ok anton

3 years agoAdd support for sdhc(4) on Raspberry Pi in ACPI mode.
kettenis [Mon, 8 Mar 2021 13:48:56 +0000 (13:48 +0000)]
Add support for sdhc(4) on Raspberry Pi in ACPI mode.

ok patrick@

3 years agoAdd RK809 to list of supported chips for this driver.
kurt [Mon, 8 Mar 2021 12:55:48 +0000 (12:55 +0000)]
Add RK809 to list of supported chips for this driver.

3 years agoAdd support for rk809 as seen on the Rock Pi N10 with the rk3399pro. Add
kurt [Mon, 8 Mar 2021 12:53:35 +0000 (12:53 +0000)]
Add support for rk809 as seen on the Rock Pi N10 with the rk3399pro. Add
support for multiple linear ranges for voltage regulators and use for all
rkpmic ICs.

ok kettenis@

3 years agoWhen introducing prefix_eligible() I botched up one if statement.
claudio [Mon, 8 Mar 2021 12:18:46 +0000 (12:18 +0000)]
When introducing prefix_eligible() I botched up one if statement.
For nexthops it is fine if they point to NULL. This is used in local
announcements. Only if they point to a real struct the state must be
NEXTHOP_REACH.
Bug reported by and OK florian@

3 years agoRevise the ASID allocation sheme to avoid a hang when running out of free
kettenis [Mon, 8 Mar 2021 11:16:26 +0000 (11:16 +0000)]
Revise the ASID allocation sheme to avoid a hang when running out of free
ASIDs.  This should only happen on systems with 8-bit ASIDs, which are
currently unsupported in OpenBSD.

The new scheme uses "generations".  Whenever we run out of ASIDs we bump
the generation and flush the complete TLB.  The pmaps of processes that
are currently on the CPU are carried over into the new generation.  This
implementation relies on the scheduler lock to make sure this happens
without any (known) races.

ok patrick@, mpi@

3 years agoMove a KERNEL_ASSERT_LOCKED() from single_thread_clear() to cursig().
mpi [Mon, 8 Mar 2021 10:54:53 +0000 (10:54 +0000)]
Move a KERNEL_ASSERT_LOCKED() from single_thread_clear() to cursig().

Ze big lock is currently necessary to ensure that two sibling threads
are not racing against each other when processing signals.  However it
is not strickly necessary to unpark sibling threads.

ok claudio@

3 years agoKill SINGLE_PTRACE and use SINGLE_SUSPEND which has almost the same semantic.
mpi [Mon, 8 Mar 2021 10:12:05 +0000 (10:12 +0000)]
Kill SINGLE_PTRACE and use SINGLE_SUSPEND which has almost the same semantic.

single_thread_set() is modified to explicitly indicated when waiting until
sibling threads are parked is required.  This is obviously not required if
a traced thread is switching away from a CPU after handling a STOP signal.

ok claudio@

3 years agosndiod: Use chronological order for {dev,port}_list
ratchov [Mon, 8 Mar 2021 09:42:50 +0000 (09:42 +0000)]
sndiod: Use chronological order for {dev,port}_list

This simplifies the logic of the initialization code, makes debug
printfs nicer and could slightly ease futur development.

No behavior change.

3 years agosndiod: Initialize dev->master_enabled earlier
ratchov [Mon, 8 Mar 2021 09:38:36 +0000 (09:38 +0000)]
sndiod: Initialize dev->master_enabled earlier

This is better style as since recently dev->master_enabled is used by
the ctlslot_xxx family functions which -- in the future -- could be
called with the device closed.

No behavior change.

3 years agosndiod: Style tweak: uniformize pattern to access ctlslot_array
ratchov [Mon, 8 Mar 2021 09:35:08 +0000 (09:35 +0000)]
sndiod: Style tweak: uniformize pattern to access ctlslot_array

3 years agouse a journal reference instead of cstr when possible
jsg [Mon, 8 Mar 2021 06:20:50 +0000 (06:20 +0000)]
use a journal reference instead of cstr when possible

3 years agoRemove the workaround which identified Go executables, and permitted them
deraadt [Mon, 8 Mar 2021 05:57:34 +0000 (05:57 +0000)]
Remove the workaround which identified Go executables, and permitted them
to do syscalls directly.  Go executables now use shared libc like all other
dynamic binaries.  This makes the "where are syscalls done from" checker
strict for all binaries, and also opens the door to change the underlying
syscall ABI to the kernel in the future very easily (if we find cause).
ok jsing

3 years agocorrect paper title
jsg [Mon, 8 Mar 2021 03:54:48 +0000 (03:54 +0000)]
correct paper title

3 years agoAdd some references, most of these were removed when we stopped building
jsg [Mon, 8 Mar 2021 02:47:25 +0000 (02:47 +0000)]
Add some references, most of these were removed when we stopped building
and installing USD/SMM/PSD docs.

jmc@ agrees with the direction, ok millert@ on an earlier diff

3 years agoExplicitly align kernel text.
mortimer [Sun, 7 Mar 2021 23:10:54 +0000 (23:10 +0000)]
Explicitly align kernel text.

lld11 no longer quietly aligns this when given an address, so we do the
alignment explicitly.

ok kettenis@

3 years agoFix aml_store() to work properly when the lvalue is a reference of
yasuoka [Sun, 7 Mar 2021 22:53:46 +0000 (22:53 +0000)]
Fix aml_store() to work properly when the lvalue is a reference of
LocalX.  In that case, resolving the reference must be done before
resetting the LocalX variable.  test daniel

ok kettenis

3 years agouse the mx hostname for sni on outgoing connection, not the reverse
eric [Sun, 7 Mar 2021 20:56:41 +0000 (20:56 +0000)]
use the mx hostname for sni on outgoing connection, not the reverse
dns for the peer address.

spotted by krw@
ok krw@ tb@

3 years agoReduce debug logging by moving protocol level debug log
florian [Sun, 7 Mar 2021 18:39:11 +0000 (18:39 +0000)]
Reduce debug logging by moving protocol level debug log
behind -vv or by deleting unneeded output.
While here reword some debug output to make it more useful.
(There is more to be done here.)

3 years agoFix intercardinal directions in hack help.
tb [Sun, 7 Mar 2021 17:08:49 +0000 (17:08 +0000)]
Fix intercardinal directions in hack help.

From Raf Czlonka

3 years agoNo need to cap the exponential backoff here, iface_timeout() already
florian [Sun, 7 Mar 2021 16:22:01 +0000 (16:22 +0000)]
No need to cap the exponential backoff here, iface_timeout() already
handles this for us by doing a state transition if we have been stuck
in "rebooting" or "requesting" for too long.
Makes the code a bit simpler and we only have one place were we need
to special case the timeout cap.

3 years agoLog ESN for child SAs if enabled.
tobhe [Sun, 7 Mar 2021 15:51:07 +0000 (15:51 +0000)]
Log ESN for child SAs if enabled.

3 years agov1/v2 find is different to pwb/v5 find
jsg [Sun, 7 Mar 2021 15:25:15 +0000 (15:25 +0000)]
v1/v2 find is different to pwb/v5 find

3 years agoPass standard DMA tag to acpi(4) table drivers.
patrick [Sun, 7 Mar 2021 15:17:58 +0000 (15:17 +0000)]
Pass standard DMA tag to acpi(4) table drivers.

ok kettenis@

3 years agoWithdraw nameservers when the interface goes down.
florian [Sun, 7 Mar 2021 10:31:57 +0000 (10:31 +0000)]
Withdraw nameservers when the interface goes down.
Problem reported by deraadt some time ago.

3 years agoFold get_lladdr into update_iface, now the only caller.
florian [Sun, 7 Mar 2021 10:31:20 +0000 (10:31 +0000)]
Fold get_lladdr into update_iface, now the only caller.
This allows us to pass the link state over to engine here instead of
in update_addr which is not available in small.
This gets us more in line dhcpleased.

3 years agoNo need to pass the link local and hw address around, we have it
florian [Sun, 7 Mar 2021 10:30:13 +0000 (10:30 +0000)]
No need to pass the link local and hw address around, we have it
already in the interface on the engine side.

3 years agoreshuffle to bring more in line with dhcpleased
florian [Sun, 7 Mar 2021 10:29:12 +0000 (10:29 +0000)]
reshuffle to bring more in line with dhcpleased

3 years agoIntroduce engine_update_if().
florian [Sun, 7 Mar 2021 10:28:44 +0000 (10:28 +0000)]
Introduce engine_update_if().
This was too much code in the imsg handler.

3 years agoLibreSSL 3.3.2
bcook [Sun, 7 Mar 2021 08:53:10 +0000 (08:53 +0000)]
LibreSSL 3.3.2

3 years agoansi
jsg [Sun, 7 Mar 2021 06:21:38 +0000 (06:21 +0000)]
ansi

3 years agoansi
jsg [Sun, 7 Mar 2021 06:20:09 +0000 (06:20 +0000)]
ansi

3 years agoansi
jsg [Sun, 7 Mar 2021 06:18:48 +0000 (06:18 +0000)]
ansi

3 years agoansi
jsg [Sun, 7 Mar 2021 06:17:03 +0000 (06:17 +0000)]
ansi

3 years agouse uint64_t ethernet addresses for compares in carp.
dlg [Sun, 7 Mar 2021 06:02:32 +0000 (06:02 +0000)]
use uint64_t ethernet addresses for compares in carp.

pass the uint64_t that ether_input has already converted from a
real ethernet address into carp_input so it can use it without
having to do its own conversion.

tested by hrvoje popovski
tested by me on amd64 and sparc64
ok patrick@ jmatthew@

3 years agowhitespace
tobhe [Sat, 6 Mar 2021 22:27:39 +0000 (22:27 +0000)]
whitespace

3 years agoFix PRINT macro, the suffix param to sshlog() was missing.
millert [Sat, 6 Mar 2021 20:36:31 +0000 (20:36 +0000)]
Fix PRINT macro, the suffix param to sshlog() was missing.
Also remove redundant __func__ prefix from PRINT calls as the macro
already adds __FILE__, __func__ and __LINE__.  From Christos Zoulas.
OK dtucker@

3 years agoSince with the current design there's one device per domain, and one
patrick [Sat, 6 Mar 2021 19:30:07 +0000 (19:30 +0000)]
Since with the current design there's one device per domain, and one
domain per pagetable, there's no need for a backpointer to the domain
in the pagetable entry descriptor.  There can't be any other domain.
Also since there's no list, no list entry member is needed either.

This reduces early allocation to half of the previous size.  I think
it's possible to reduce it even further and not need a pagetable entry
descriptor at all, but I need to think about that a bit more.

3 years agoOne major issue talked about in research papers is reducing the overhead
patrick [Sat, 6 Mar 2021 19:25:27 +0000 (19:25 +0000)]
One major issue talked about in research papers is reducing the overhead
of the IOVA allocation.  As far as I can see the current "best solution"
is to cache IOVA ranges in percpu magazines.  I don't think we have this
issue at all thanks to bus_dmamap_create(9).  The map is created ahead
of time, and we know the maximum size of the DMA transfer.  Since with
smmu(4) we have IOVA per domain, allocating IOVA 'early' is essentially
free.  But pagetable mapping also incurs a performance penalty, since we
allocate pagetable entry descriptors through pools.  Since we have the
IOVA early, we can allocate those early as well.  This allocation is a
bit more expensive though, but can be optimized further.

All this means that there is no allocation overhead in hot code paths.
The "only" thing remaining is assigning IOVA to the segments, adjusting
the pagetable mappings, and flushing the IOTLB on unload.  Maybe there's
a way to do a combined flush for NICs, because we give a list of mbufs
to the network stack and we could do the IOTLB invalidation only once
right before we hand over the mbuf list to the upper layers.

3 years agoImplement last remaining bits to update from RFC 4941 to RFC 8981.
florian [Sat, 6 Mar 2021 19:02:53 +0000 (19:02 +0000)]
Implement last remaining bits to update from RFC 4941 to RFC 8981.
The desync factor is now tracked per temporary IP and the max value
has been increased to about 9 hours.
While here fix a bug where the minimum acceptable pltime in a router
advertisement should be bigger than PRIV_REGEN_ADVANCE not the desync
factor (which didn't make any sense at all).

From Fernando Gont, thanks!
OK sthen

3 years agoTurns out there are dhcp servers that ignore DHCPREQUEST messages when
florian [Sat, 6 Mar 2021 18:33:44 +0000 (18:33 +0000)]
Turns out there are dhcp servers that ignore DHCPREQUEST messages when
they don't like them instead of sending a DHCPNAK. Found the hard way
by benno who didn't want to wait 127 seconds.

Due to another bug dhcpleased would have exit through a fatal() in the
frontend process if he had waited long enough for a Rebooting -> Init
transition because we didn't deconfigure our IP address and thus
didn't close our UDP socket. Upon configuring a new IP address we would
open a new UDP socket send it to the frontend which would then fatal()
due to an unexpected fd passed in.

Aproporiate timings are rather underspecified in RFC 2131. Instead of
doing an exponential backoff up to 64 in the "Rebooting" and
"Requesting" state only go up to 2 for a total of 3 packets and total
timeout of 3 seconds before going into "Init" state and sending a
DHCPDISCOVER.

To prevent the fatal() in the frontend process we reshuffle the state
transition into the "Init" state and deconfigure the IP when
appropriate.

3 years agosync
deraadt [Sat, 6 Mar 2021 16:09:50 +0000 (16:09 +0000)]
sync

3 years agoansi
jsg [Sat, 6 Mar 2021 09:20:49 +0000 (09:20 +0000)]
ansi

3 years agoput back Lst_Destroy(paths) where it belongs
espie [Sat, 6 Mar 2021 08:31:42 +0000 (08:31 +0000)]
put back Lst_Destroy(paths) where it belongs
noticed by jsg@

3 years agoPrint PFS group for rekeyed Child SAs.
tobhe [Fri, 5 Mar 2021 22:26:04 +0000 (22:26 +0000)]
Print PFS group for rekeyed Child SAs.

ok patrick@

3 years agoLog transforms of established IKE and Child SAs.
tobhe [Fri, 5 Mar 2021 22:08:25 +0000 (22:08 +0000)]
Log transforms of established IKE and Child SAs.

ok patrick@

3 years agoMove policy printing code from parse.y to new print.c
tobhe [Fri, 5 Mar 2021 22:03:51 +0000 (22:03 +0000)]
Move policy printing code from parse.y to new print.c

ok patrick@

3 years agoAvoid print for NULL pointer
jan [Fri, 5 Mar 2021 20:06:39 +0000 (20:06 +0000)]
Avoid print for NULL pointer

The subclass arrays have to be empty.

OK deraadt@

3 years agoFix regress tests after changes to tal.c, mft.c, and cert.c.
claudio [Fri, 5 Mar 2021 17:28:09 +0000 (17:28 +0000)]
Fix regress tests after changes to tal.c, mft.c, and cert.c.

3 years agoFactor out the URI check we do in various places into valid_uri().
claudio [Fri, 5 Mar 2021 17:15:19 +0000 (17:15 +0000)]
Factor out the URI check we do in various places into valid_uri().
RRDP will add a bunch more checks so this makes even more sense.
With and OK tb@

3 years agoIf there is a problem with opening a directory via M-x dired, let the
lum [Fri, 5 Mar 2021 16:16:53 +0000 (16:16 +0000)]
If there is a problem with opening a directory via M-x dired, let the
user know. EACCESS is currently accounted for, but nothing else.

3 years agoFactor out the SHA256 hash checks into valid_filehash() so that it can
claudio [Fri, 5 Mar 2021 16:00:00 +0000 (16:00 +0000)]
Factor out the SHA256 hash checks into valid_filehash() so that it can
be used by the RRDP code as well.
OK tb@

3 years agoTest case for read-only array being not that read-only in ksh.
zhuk [Fri, 5 Mar 2021 15:24:37 +0000 (15:24 +0000)]
Test case for read-only array being not that read-only in ksh.

okay tb@

3 years agoFix old ksh bug: wrong variable being looked up when value is provided.
zhuk [Fri, 5 Mar 2021 15:22:03 +0000 (15:22 +0000)]
Fix old ksh bug: wrong variable being looked up when value is provided.

This results, e.g., in allowing the first item of a read-only array to
be overwritten, as found by Jordan Geoghegan.

okay tb@

3 years agoansi
jsg [Fri, 5 Mar 2021 13:20:19 +0000 (13:20 +0000)]
ansi