terminfo: Remove unused terminfo.tmp and run_tic.sed from Makefile
* The generated run_tic.sed is empty, so the modified terminfo.tmp is
identical to the original terminfo.src.
* The generated terminfo.tmp is not actually used by run_tic.sh to build
the entries.
So remove both to clean up. while there, also remove the unnecessary
NOMAN.
terminfo: Improve the Makefile for entries installation
* Use FILESGROUPS and related macros from <bsd.files.mk> to install the
entries, replacing the manual explicit "install" target.
* Use the default SHAREMODE (i.e., 444) instead of the custom 644 mode
for installed entries.
* Use the more conventional <bsd.prog.mk> instead of <bsd.lib.mk>, as
used by share/termcap, share/tabset, etc.
terminfo: Fix entries compilation to output to ${.OBJDIR}
Fix the ${ticdir} and @TERMINFO@ to point to paths in ${.OBJDIR}, so
that the intermediate outputs and compiled entries are all located in
${.OBJDIR}.
In addition, ignore ${DESTDIR} for `run_tic.sh` so the entries output
directory is unaffected during the buildworld, which sets a DESTDIR.
While there, clean up the `run_tic.sh` target to specify the prereq and
to remove the unnecessary `cat` command.
terminfo: Auto generate entries list from the source terminfo.src
Replace the hand-crafted entries list in Makefile.entries with an
auto-generated one by an awk script, so that it becomes future-proof.
The auto-generated list contains 2780 entries, adding 160 new entries
over the previous stale list, which contained 2620 entries. In
particular, the new entries include alacritty, kitty, dvtm, etc.
libc: Move thread symbols from gen/Symbol.map to thread/Symbol.map
Commit 28e770f9356419201058747986287acae231f334 merged libthread_xu into
libc, and commit aaef2979773f2bfc0f661b17be90d5e5b82b505b moved the
libthread_xu source to libc/thread. This commit completes the merge by
moving the thread symbols that implemented in libc/thread from
libc/gen/Symbol.map to libc/thread/Symbol.map, so that the Symbol.map
keeps in sync with the source.
kernel - Fix in6_pcbsetlport() panic
* An assertion is issued after lport is modulo-incremented but
before checking to see if the loop has exhausted.
This can result in a field overflow causing the assertion to
fail.
* Fix by moving the assertion to the correct place.
kernel - Fix in6_pcbsetlport() panic
* An assertion is issued after lport is modulo-incremented but
before checking to see if the loop has exhausted.
This can result in a field overflow causing the assertion to
fail.
* Fix by moving the assertion to the correct place.
netinet: Maintain RTF_LOCAL in the kernel
* Expose in_rtlocalize() for using in route_output_change_callback() to
correctly set RTF_LOCAL, taking into account of the IFA/IFP changes.
* Add RTF_LOCAL to PRESERVED_RTF and ignore the RTF_LOCAL flag from
userspace, making this flag be maintained by the kernel.
* Clean up arp_rtrequest() to directly check the RTF_LOCAL flag instead
of comparing the IP addresses.
net: Normalize IPv4 /32 route to a host route (RTF_HOST)
An IPv4 /32 route denotes a host route (RTF_HOST). Add the
rt_hostroute_normalize() helper to normalize such routes by setting the
RTF_HOST flag. Use the helper in both rtrequest1() and
rtsearch_msghandler() so that this normalization applies to RTM_ADD,
RTM_GET, RTM_CHANGE and RTM_LOCK.
netinet: Move loopback route maintain functions to in.c
The ifa_{add,del}_loopback_route() functions are only used in
netinet/in.c, so just move them to there and make them static.
Meanwhile, rename them to in_{add,del}_loopback_route() for consistency.
gmp: Clean up makefile
* Use per-target flags "FLAGS.<target>" to replace the FLAGS_GROUPS,
expressing the intention/requirement more clearly.
* Introduce helper varaibles to clean up the loop code.
* Remove the unused "mpn/generic" directory.
netinet: Clean up interface routes handling in arp_rtrequest()
in_addroute() gives every non-host, non-multicast IPv4 route either
RTF_CLONING or RTF_PRCLONING, so manually added interface routes would
have RTF_PRCLONING. As a result, we can clean up arp_rtrequest() to
check either RTF_CLONING or RTF_PRCLONING in handling a cloned route,
without hacking the RTF_CLONING flag.
An edge case is a non-host route with a "/32" mask. However, that case
doesn't make practical sense and should be normalized to a host route.
That will be addressed in the coming commits.
net: Handle R_Malloc() failure in rt_setshims()
Introduce the rt_freeshims() helper to free the memory allocated by
rt_setshims(), and also call it in rtrequest1() to avoid potential
memory leak.
This only applies MPLS.
netinet: Improve local routes handling in in_addroute()
* Extract the in_rtlocalize() helper function to improve the handling of
local routes, including explicit loopback routes added by
ifa_add_loopback_route().
* Skip modifying IFA/IFP for the explicit loopback routes, and thus
remove the pre-setting RTF_LOCAL from ifa_maintain_loopback_route().
No functional changes.
nd6: keep foreign-CPU neighbors off the timer and purge list
Route requests create neighbor entries on each network CPU, but timers
and purge run on CPU 0. Purging a foreign-CPU entry deletes the matching
local route and can follow its freed neighbor entry. Link only CPU 0
entries into the list and unlink only linked entries; keep other CPUs
route-local neighbor data.
Bug: https://bugs.dragonflybsd.org/issues/3439
pf.conf.5: describe IPv6 fragment filtering without reassembly
IPv6 fragments are filtered as the Fragment header protocol, not blocked
unconditionally. State that port/type rules cannot pass them and that a
broad pass rule does not enforce those restrictions.
Bug: https://bugs.dragonflybsd.org/issues/3438
netinet: fix ARP resolution during the first second of uptime
A cloned route created while time_uptime is zero passes a zero expiry
to its neighbors. Zero denotes a permanent entry, so unresolved dynamic
neighbors never send ARP requests.
Add the arp_expire_unresolved (= time_uptime + 1) to keep dynamic expiry
nonzero and track the last request time separately, using la_asked to
indicate whether that time is valid. This preserves same-second rate
limiting and permanent-entry semantics without changing the routing ABI.
While there, fix the code to add arpt_down to rt_expire only when it's a
cloned route.
Co-authored-by: Aaron LI <aly at aaronly.me>
GitHub-PR: https://github.com/DragonFlyBSD/DragonFlyBSD/pull/58
dsynth - Do not cross mount boundaries when making template's /etc
* When making the template's /etc, do not cross mount boundaries.
* This is a bit of a hack but /etc/namedb sometimes has a "dev"
subdirectory for its chroot area that mounts devfs. This kinda
implodes when we later try to tmpfs it.
dsynth - Apply the "debug" directive to ports-mgmt/pkg
The debug directive was not being applied to ports-mgmt/pkg,
so we couldn't retain the mounts for debugging purposes when
explicitly building that target.
Adjust the (s4) string to recognize multiple flags, since fixing
this requires two flags to be passed in.
Reported-by: aly
kernel - Fix I/O stalls caused by TRIM ops
* I/O can stall out in physstr when TRIM ops are delpoyed. The
cause is that the da_softc->outstanding_cmds_rd tracker used by
the I/O balancer was decrementing the field on TRIM completions.
* Fix by ensuring that the tracker only applies to READ commands.
* Refactor scheduling checks in dastart(). The checks were a bit broken
but worked due to a catch-all in dadone(). Refactor so they work properly.
* Refactor conditional/block syntax a bit for readability.
Reported-by: myself and numerous others
kern: avoid reading a disk label while dumping
Checking an unlabelled dump slice can trigger a disk-label read through
normal buffered I/O. During a crash dump, that read can wait indefinitely
before the dump writer reaches its polled I/O path.
Skip the label read while dumping and use the slice bounds already held
in memory, keeping the normal label probe outside the dump path.
Bug: https://bugs.dragonflybsd.org/issues/3441
kern: skip module shutdown handlers on panic
module_shutdown() is a shutdown_post_sync handler, so it also runs on the
panic path after the panicking CPU has stopped the other CPUs. Some
MOD_SHUTDOWN handlers block on kernel threads that cannot run once their
CPU is stopped: vn calls disk_destroy(), and disk_msg_send_sync() then
waits forever for the disk_msg_core thread. The machine hangs after
"Dump complete" and never reboots.
Skip the module shutdown handlers on a panic, as resettodr_on_shutdown()
and shutdown_kproc() already do. The dump is already written when this
handler runs.
Reproduced in a QEMU/NVMM guest: panic + dump with
hw.acpi.handle_reboot=1 hangs at "Dump complete" on SMP and reboots on a
single CPU. With this change the guest reboots with
hw.acpi.handle_reboot 1 and 0, with and without a dump.
Bug: https://bugs.dragonflybsd.org/issues/3450
dsynth - Fix improper deletions with "prepare-system"
* Don't delete "obsolete" packages for "prepare-system"
* Obsolete packages can only be properly deleted when
a full scan is done. "prepare-system" only does a
partial scan so it winds up deleting stuff it
should not delete.
pf: fix IPv6 fragment length checks
ip6_plen excludes the IPv6 header, but off includes it. Check packet and
fragment-header bounds, use matching length units, and reject misaligned
non-final fragments. Include pre-fragment extension headers in the
reassembled payload limit.
Bug: https://bugs.dragonflybsd.org/issues/3437
ndp(8): avoid deleting covering routes and report socket errors
RTM_GET can return a covering route for an absent neighbor. Require the
requested address and an NDP route before deletion. Return failure for
routing-socket write, read and reply errors, and pass deletion failure
to the exit status.
Bug: https://bugs.dragonflybsd.org/issues/3436