dragonfly.git
4 years agosbin/hammer2: Don't show 0 freemap stats in quiet mode
Tomohiro Kusumi [Wed, 18 Sep 2019 21:35:34 +0000 (06:35 +0900)]
sbin/hammer2: Don't show 0 freemap stats in quiet mode

Quiet mode has been ignoring freemap stats, so separate freemap
stats from data.

4 years agosbin/hammer2: Show freemap stats for all bitmap states
Tomohiro Kusumi [Wed, 18 Sep 2019 17:01:46 +0000 (02:01 +0900)]
sbin/hammer2: Show freemap stats for all bitmap states

Add "Total possibly free storage" and "Total allocated storage"
stats which correspond to bitmap value of 2 and 3.

In addition to above, add "Total unavailable storage" (boot/aux/etc)
and "Total freemap storage". The total freemap storage value should
be sum of all others.

Note that unallocated or allocated stats represent space out of
freemap leaf that can be traversed from root, excluding space for
boot/aux/etc area. Not out of the entire device.

4 years agosbin/hammer2: Use appropriate macros and typedefs in CountFreeBlocks()
Tomohiro Kusumi [Wed, 18 Sep 2019 16:33:52 +0000 (01:33 +0900)]
sbin/hammer2: Use appropriate macros and typedefs in CountFreeBlocks()

4 years agosbin/hammer2: Fix CountFreeBlocks()
Tomohiro Kusumi [Tue, 17 Sep 2019 17:46:25 +0000 (02:46 +0900)]
sbin/hammer2: Fix CountFreeBlocks()

Need to do 2 or 8 bit shift in each loop.

4 years agodsynth.1: Ada is the name of a person, not an acronym.
Sascha Wildner [Tue, 17 Sep 2019 20:31:08 +0000 (22:31 +0200)]
dsynth.1: Ada is the name of a person, not an acronym.

While here, start sentences on a new line and change 'cpu' to 'CPU',
because _that_ is an acronym. :)

4 years agosys/vfs/hammer2: hammer2_chain_t is unneeded for dummy blockref
Tomohiro Kusumi [Mon, 16 Sep 2019 16:34:11 +0000 (01:34 +0900)]
sys/vfs/hammer2: hammer2_chain_t is unneeded for dummy blockref

hammer2_chain_create_indirect() only needs hammer2_blockref_t
part of chain as a local variable. Do the same as hammer2_chain_create()
to save stack a bit.

4 years agosys/vfs/hammer2: Cleanup freemap index calculation
Tomohiro Kusumi [Mon, 16 Sep 2019 13:02:13 +0000 (22:02 +0900)]
sys/vfs/hammer2: Cleanup freemap index calculation

Freemap bitmaps (64KB x 5levels x 8rotations) exist in the first
4MB area of every 1GB, so bitmap offset mask should be 4MB-1 rather
than 1GB-1. It explicitly wants to clear bit 22-29.

This doesn't change the result since bref->data_off for freemap
itself has to have 0 for bit 22-29.

4 years agosbin/hammer2: Add assertion for freemap index in "show"
Tomohiro Kusumi [Mon, 16 Sep 2019 12:58:31 +0000 (21:58 +0900)]
sbin/hammer2: Add assertion for freemap index in "show"

Test lower end of index.

4 years agowtmpcvt.1: Fix a path and use .Mt for email addresses.
Sascha Wildner [Tue, 17 Sep 2019 07:40:49 +0000 (09:40 +0200)]
wtmpcvt.1: Fix a path and use .Mt for email addresses.

4 years agovkernel - Add MD_PAGE_FREEABLE() dummy macro
Matthew Dillon [Sun, 15 Sep 2019 20:19:50 +0000 (13:19 -0700)]
vkernel - Add MD_PAGE_FREEABLE() dummy macro

* Add a dummy macro for MD_PAGE_FREEABLE() so the vkernel builds.

* Fix vkernel compile error due to st_blksize size change.

Reported-by: swildner
4 years agoUpdate the pciconf(8) database.
Sascha Wildner [Sun, 15 Sep 2019 19:36:42 +0000 (21:36 +0200)]
Update the pciconf(8) database.

September 14, 2019 snapshot from https://pci-ids.ucw.cz

4 years agosbin/hammer2: Remove dofreemap argument from show_bref()
Tomohiro Kusumi [Sun, 15 Sep 2019 19:19:09 +0000 (04:19 +0900)]
sbin/hammer2: Remove dofreemap argument from show_bref()

208afee512 removed `dofreemap` test from show_bref() by having
HAMMER2_BREF_TYPE_FREEMAP switch/case for blockref type,
so `dofreemap` is no longer needed in show_bref().

Blockref itself contains `dofreemap` information.

4 years agoboot/efi: Sync our TianoCore EDK II headers with the edk2-stable201908 tag.
Sascha Wildner [Sun, 15 Sep 2019 15:12:29 +0000 (17:12 +0200)]
boot/efi: Sync our TianoCore EDK II headers with the edk2-stable201908 tag.

Not much to see here. Mostly whitespace in comments.

4 years agosbin/fsck_msdosfs: u_int32_t -> uint32_t
Tomohiro Kusumi [Sat, 14 Sep 2019 22:54:03 +0000 (07:54 +0900)]
sbin/fsck_msdosfs: u_int32_t -> uint32_t

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@853a3e49 (fix cluster chain check)
Tomohiro Kusumi [Sat, 14 Sep 2019 22:33:39 +0000 (07:33 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@853a3e49 (fix cluster chain check)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@7716a7c6 (be permissive)
Tomohiro Kusumi [Sat, 14 Sep 2019 22:30:50 +0000 (07:30 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@7716a7c6 (be permissive)

and freebsd/freebsd@4216ffd6.

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@915380d5 (preen flag)
Tomohiro Kusumi [Sat, 14 Sep 2019 22:12:00 +0000 (07:12 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@915380d5 (preen flag)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@f4323232 (style(9))
Tomohiro Kusumi [Sat, 14 Sep 2019 21:49:11 +0000 (06:49 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@f4323232 (style(9))

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@55bd3d12 (fix index)
Tomohiro Kusumi [Sat, 14 Sep 2019 22:02:15 +0000 (07:02 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@55bd3d12 (fix index)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@3bf7697a (prevent OOB access when corrupted)
Tomohiro Kusumi [Sat, 14 Sep 2019 21:58:37 +0000 (06:58 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@3bf7697a (prevent OOB access when corrupted)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@7a3e0d6f (fix readboot() check)
Tomohiro Kusumi [Sat, 14 Sep 2019 21:56:07 +0000 (06:56 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@7a3e0d6f (fix readboot() check)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@9d029ca4 (fix build)
Tomohiro Kusumi [Sat, 14 Sep 2019 21:53:15 +0000 (06:53 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@9d029ca4 (fix build)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@3b04951c (use MAX())
Tomohiro Kusumi [Sat, 14 Sep 2019 21:42:07 +0000 (06:42 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@3b04951c (use MAX())

and remaining bits from freebsd/freebsd@d704245c.

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@e2cfe252 (optimize memsets)
Tomohiro Kusumi [Sat, 14 Sep 2019 21:39:30 +0000 (06:39 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@e2cfe252 (optimize memsets)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@89f9bddc (properly restore lfcl)
Tomohiro Kusumi [Sat, 14 Sep 2019 21:35:43 +0000 (06:35 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@89f9bddc (properly restore lfcl)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@375de295 (fixes from other BSDs)
Tomohiro Kusumi [Sat, 14 Sep 2019 21:32:11 +0000 (06:32 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@375de295 (fixes from other BSDs)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@9503e2d6 (distinguish lseek)
Tomohiro Kusumi [Sat, 14 Sep 2019 21:22:49 +0000 (06:22 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@9503e2d6 (distinguish lseek)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@f7ba4b24 (assertion)
Tomohiro Kusumi [Sat, 14 Sep 2019 21:16:04 +0000 (06:16 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@f7ba4b24 (assertion)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@4438d719 (boot block)
Tomohiro Kusumi [Sat, 14 Sep 2019 20:49:56 +0000 (05:49 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@4438d719 (boot block)

Also bring in
freebsd/freebsd@d0f63ec230e612c0a7e95af6f95e401ddace4ac3
freebsd/freebsd@37cb22f7f4cfc363dfe7e014ca1155275ac2e55c
freebsd/freebsd@d85e2bfb0863227627e47856cb9a556a8f42a7ad

4 years agosbin/fsck_msdosfs: Minor fixes/sync with FreeBSD
Tomohiro Kusumi [Sat, 14 Sep 2019 20:32:31 +0000 (05:32 +0900)]
sbin/fsck_msdosfs: Minor fixes/sync with FreeBSD

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@ce102225 (respect FSFIXFAT)
Tomohiro Kusumi [Sat, 14 Sep 2019 20:24:18 +0000 (05:24 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@ce102225 (respect FSFIXFAT)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@39c1449b (fix prompts)
Tomohiro Kusumi [Sat, 14 Sep 2019 20:21:37 +0000 (05:21 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@39c1449b (fix prompts)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@53d879fa (mix of unrelated changes...)
Tomohiro Kusumi [Sat, 14 Sep 2019 19:59:49 +0000 (04:59 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@53d879fa (mix of unrelated changes...)

4 years agokernel - Fix improper use of CMSG_ALIGN() in unp_internalize()
Matthew Dillon [Sun, 15 Sep 2019 03:14:18 +0000 (20:14 -0700)]
kernel - Fix improper use of CMSG_ALIGN() in unp_internalize()

* The data portion of a control message must be aligned, but the
  data length does not have to be (and in fact, should not be since
  it might represent an array of smaller elements and we do not
  want to calculate the wrong number of elements).

* Fixes chrome, xpdf, etc (sendmsg() calls were failing).

* Problem revealed after the CMSG alignment was upped from 4 to 8
  bytes.

4 years agonfs - Fix utimes() bugs in NFS
Matthew Dillon [Sat, 14 Sep 2019 21:59:11 +0000 (14:59 -0700)]
nfs - Fix utimes() bugs in NFS

* Over the years I have tried very hard to avoid flushing pending writes
  when issuing [l]utimes() operations (i.e. setattr VOPs) in NFS, but
  it just causes issues every time.

* Give up.  We now flush pending writes prior to setattr() operations which
  adjust mtime.  This will slow down certain operations such as cp -Rp,
  cpdup, etc, but should improve the consistency and reliability of
  timestamps.

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@437a93c1 (test ./.. for dir dirents)
Tomohiro Kusumi [Sat, 14 Sep 2019 18:29:38 +0000 (03:29 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@437a93c1 (test ./.. for dir dirents)

Also bring in freebsd/freebsd@76844b29.

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@c4e91f79 (cleanup)
Tomohiro Kusumi [Sat, 14 Sep 2019 18:24:32 +0000 (03:24 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@c4e91f79 (cleanup)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@136be466 (s/filesystem/file system/)
Tomohiro Kusumi [Sat, 14 Sep 2019 18:16:44 +0000 (03:16 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@136be466 (s/filesystem/file system/)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@07ebfe1b (add va_end())
Tomohiro Kusumi [Sat, 14 Sep 2019 17:56:17 +0000 (02:56 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@07ebfe1b (add va_end())

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@95647bc8 (fix ask())
Tomohiro Kusumi [Sat, 14 Sep 2019 17:53:30 +0000 (02:53 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@95647bc8 (fix ask())

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@cbe11b37 (add \n)
Tomohiro Kusumi [Sat, 14 Sep 2019 17:00:06 +0000 (02:00 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@cbe11b37 (add \n)

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@d704245c (s/perror/perr/)
Tomohiro Kusumi [Sat, 14 Sep 2019 03:23:31 +0000 (12:23 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@d704245c (s/perror/perr/)

Ignore most of sbin/fsck part (not in sync with FreeBSD at all).

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@ce3384ad (bsdl changes from NetBSD)
Tomohiro Kusumi [Sat, 14 Sep 2019 02:23:37 +0000 (11:23 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@ce3384ad (bsdl changes from NetBSD)

and freebsd/freebsd@7551d83c.

4 years agosbin/fsck_msdosfs: Bring in freebsd/freebsd@1bb580c8 (rename struct fields)
Tomohiro Kusumi [Sat, 14 Sep 2019 00:18:43 +0000 (09:18 +0900)]
sbin/fsck_msdosfs: Bring in freebsd/freebsd@1bb580c8 (rename struct fields)

4 years agotmpfs - Close rare vnode recycle race
Matthew Dillon [Sat, 14 Sep 2019 14:35:51 +0000 (07:35 -0700)]
tmpfs - Close rare vnode recycle race

* Keep the node lock held when clearing tn_vnode in tmpfs_reclaim()
  to protect against a use-after-free race on tn_vnode against another
  thread.

* Keep the node locked across the node type check and vnode
  ref in tmpfs_unmount() to protect against asynchronous
  reclamation races.

4 years agokernel - Add needed ccfence and more error checks
Matthew Dillon [Sat, 14 Sep 2019 14:33:15 +0000 (07:33 -0700)]
kernel - Add needed ccfence and more error checks

* Add a cpu_ccfence() to PMAP_PAGE_BACKING_SCAN in order to prevent
  over-optimization of the ipte load by the compiler.

* Add machine-dependent assertion in the vm_page_free*() path to
  ensure that the page is not normally mapped at the time of the
  free.

4 years agodsynth(1): Fix DPADD situation in the Makefile.
Sascha Wildner [Sat, 14 Sep 2019 12:58:39 +0000 (14:58 +0200)]
dsynth(1): Fix DPADD situation in the Makefile.

4 years agodsynth(1): Fix 'make install' with $DESTDIR set.
Sascha Wildner [Sat, 14 Sep 2019 12:40:20 +0000 (14:40 +0200)]
dsynth(1): Fix 'make install' with $DESTDIR set.

Now that the creation of /usr/share/dsynth is in the mtree file
(see 652cecd95046a092589807c7eea9799b71530ca4) and given that dsynth
is hooked into the build too, we could remove the beforeinstall
target, but it might still be useful for people running release,
for example. So keep it instead and fix it for when $DESTDIR is set.

4 years agomtree: Fix installworld
Antonio Huete Jimenez [Sat, 14 Sep 2019 11:42:38 +0000 (13:42 +0200)]
mtree: Fix installworld

4 years agossh: Declare that we have memset_s().
Sascha Wildner [Sat, 14 Sep 2019 08:47:59 +0000 (10:47 +0200)]
ssh: Declare that we have memset_s().

This doesn't seem to do anything in openssh's source but set it
anyway.

4 years agolibc/string: Add memset_s(3).
Sascha Wildner [Sat, 14 Sep 2019 08:47:04 +0000 (10:47 +0200)]
libc/string: Add memset_s(3).

Taken-from: FreeBSD

4 years ago<stdlib.h>: Fix typedef guard.
Sascha Wildner [Sat, 14 Sep 2019 08:45:58 +0000 (10:45 +0200)]
<stdlib.h>: Fix typedef guard.

4 years agolibc/string: Sort MLINKS
Sascha Wildner [Sat, 14 Sep 2019 07:55:07 +0000 (09:55 +0200)]
libc/string: Sort MLINKS

4 years agogetifaddrs.3: Fix .Dd
Sascha Wildner [Sat, 14 Sep 2019 07:36:59 +0000 (09:36 +0200)]
getifaddrs.3: Fix .Dd

4 years agodsynth - Fix repository generation
Matthew Dillon [Sat, 14 Sep 2019 02:17:02 +0000 (19:17 -0700)]
dsynth - Fix repository generation

* pkg repo generates .txz files no matter what the suffix.  So if the
  suffix is not .txz we have to recompress the results.

* Supply the base path to pkg repo (sans the '/All') so the generated
  yaml properly specififes the relative path "All/blahblah".  Otherwise
  the generated yaml will just generate "blahblah" and rmeote accesses
  wont be able to find the packages.

4 years agosynth.1: Fix some typos/markup.
Sascha Wildner [Fri, 13 Sep 2019 20:52:06 +0000 (22:52 +0200)]
synth.1: Fix some typos/markup.

4 years agoworld - Add dsynth to the build
Matthew Dillon [Fri, 13 Sep 2019 17:11:05 +0000 (10:11 -0700)]
world - Add dsynth to the build

* Add dsynth to the world build.

4 years agoworld - More ABI breakage
Matthew Dillon [Fri, 13 Sep 2019 16:54:33 +0000 (09:54 -0700)]
world - More ABI breakage

* Make more structural changes that will break ABIs.  Since we are
  breaking ABI's we might as well get as much of it done as possible.

  struct datum (ndbm and rpcsvc)
  struct stat (see note below)
  struct ipc_perm (sysv messaging and ipc)

* The struct stat changes use a spare field so the structure
  size has NOT changed.  The kernel has been modified to fill
  in the 'old' field for ABI compatibility.

  The other structures, however, will break ABIs, particularly
  struct ipc_perm.

* Tested with a full world + kernel build.  Additional work in
  dports will be needed, certainly a whole new package set for
  master (also needed due to other ABI-breaking commits).

Submitted-by: swildner
4 years agosbin/newfs_hammer2: Use sbin/hammer2/subs.c
Tomohiro Kusumi [Thu, 12 Sep 2019 19:28:45 +0000 (04:28 +0900)]
sbin/newfs_hammer2: Use sbin/hammer2/subs.c

This is same as how sbin/newfs_hammer makes use of common code
in sbin/hammer.

4 years agosbin/hammer2: Move hammer2_demon() to cmd_service.c
Tomohiro Kusumi [Thu, 12 Sep 2019 19:26:41 +0000 (04:26 +0900)]
sbin/hammer2: Move hammer2_demon() to cmd_service.c

Remove dependencies (global variables and pthread) from subs.c
to make it usable from newfs_hammer2(8) which defines several
duplicated functions.

4 years agosbin/hammer2: Use libkern instead of sbin/hammer2/icrc.c
Tomohiro Kusumi [Thu, 12 Sep 2019 19:11:48 +0000 (04:11 +0900)]
sbin/hammer2: Use libkern instead of sbin/hammer2/icrc.c

sys/vfs/hammer2 and sbin/newfs_hammer2 uses libkern.
Remove sbin/hammer2/icrc.c.

Also see d557434b1f5510b6fed895379af444f0d034c07b,
freebsd/freebsd@d22f1350d2b99a2c94df984d76b37089bc7d610a.

4 years agoUpdate README
Roy Marples [Fri, 13 Sep 2019 13:00:36 +0000 (14:00 +0100)]
Update README

4 years agoMerge branch 'vendor/DHCPCD'
Roy Marples [Fri, 13 Sep 2019 12:48:15 +0000 (13:48 +0100)]
Merge branch 'vendor/DHCPCD'

4 years agoImport dhcpcd-8.0.6 with the following changes:
Roy Marples [Fri, 13 Sep 2019 12:44:27 +0000 (13:44 +0100)]
Import dhcpcd-8.0.6 with the following changes:

  *  inet6: Fix default route not being installed
  *  DHCP: If root fs is network mounted, enable last lease extend
  *  man: Fix lint errors.
  *  BSD: avoid RTF_WASCLONED routes
  *  DHCP: Give a better message when packet validation fails
  *  DHCP: Ensure we have enough data to checksum IP and UDP

The last change fixes a potential DoS attack introduced in dhcpcd-8.0.3
when the checksuming code was changed to accomodate variable length IP headers.

4 years agodhcpcd(8): define HAVE_IFAM_ADDRFLAGS
Roy Marples [Fri, 13 Sep 2019 09:13:07 +0000 (10:13 +0100)]
dhcpcd(8): define HAVE_IFAM_ADDRFLAGS

As we can now pickup address flags from the ifa_msghdr message
from route(4).

4 years agopam_lastlog.8: Fix .Xr's
Sascha Wildner [Fri, 13 Sep 2019 06:46:32 +0000 (08:46 +0200)]
pam_lastlog.8: Fix .Xr's

4 years agoutmpx.5: Fix .Xr
Sascha Wildner [Fri, 13 Sep 2019 06:44:49 +0000 (08:44 +0200)]
utmpx.5: Fix .Xr

4 years agoinet6: Ensure that icmp6_error checks mbuf is for IPv6
Roy Marples [Thu, 12 Sep 2019 23:53:25 +0000 (00:53 +0100)]
inet6: Ensure that icmp6_error checks mbuf is for IPv6

Unsure where this error lies, but commit 5772e17c exposes this.
For now, add a diagnostic to the console and a note to where this
can be triggered - ping6 an unresolvable IPv6 address.

4 years agoroute: Remove ifam_pid for the time being.
Roy Marples [Thu, 12 Sep 2019 18:26:58 +0000 (19:26 +0100)]
route: Remove ifam_pid for the time being.

We lose curproc in netisr0 and I don't see a way of getting
it easily. Will work on this in the future.

4 years agosbin/fsck_msdosfs: Bring in FreeBSD/Git 66dd3f2b (don't cast malloc(3))
Tomohiro Kusumi [Thu, 12 Sep 2019 14:24:12 +0000 (23:24 +0900)]
sbin/fsck_msdosfs: Bring in FreeBSD/Git 66dd3f2b (don't cast malloc(3))

4 years agosbin/fsck_msdosfs: Bring in FreeBSD/Git 0d367b12 (fix LFN check)
Tomohiro Kusumi [Thu, 12 Sep 2019 14:21:50 +0000 (23:21 +0900)]
sbin/fsck_msdosfs: Bring in FreeBSD/Git 0d367b12 (fix LFN check)

4 years agosbin/fsck_msdosfs: Bring in FreeBSD/Git 41a4c010 (use calloc(3))
Tomohiro Kusumi [Thu, 12 Sep 2019 14:17:17 +0000 (23:17 +0900)]
sbin/fsck_msdosfs: Bring in FreeBSD/Git 41a4c010 (use calloc(3))

4 years agosbin/fsck_msdosfs: Bring in FreeBSD/Git 10a5b874 (fix -F comment)
Tomohiro Kusumi [Thu, 12 Sep 2019 13:44:40 +0000 (22:44 +0900)]
sbin/fsck_msdosfs: Bring in FreeBSD/Git 10a5b874 (fix -F comment)

4 years agosbin/fsck_msdosfs: Bring in FreeBSD/Git f2e7bd69 (remove unused extern)
Tomohiro Kusumi [Thu, 12 Sep 2019 13:42:02 +0000 (22:42 +0900)]
sbin/fsck_msdosfs: Bring in FreeBSD/Git f2e7bd69 (remove unused extern)

4 years agosbin/fsck_msdosfs: Bring in FreeBSD/Git 9502e5ba (fix fullpath())
Tomohiro Kusumi [Thu, 12 Sep 2019 13:36:55 +0000 (22:36 +0900)]
sbin/fsck_msdosfs: Bring in FreeBSD/Git 9502e5ba (fix fullpath())

4 years agobuild: define CMSG_ALIGN using __ALIGNBYTES
Roy Marples [Thu, 12 Sep 2019 12:20:29 +0000 (13:20 +0100)]
build: define CMSG_ALIGN using __ALIGNBYTES

Temporarily define __ALIGNBYTES here as well, but it should
be moved to somewhere X64_64 specific.

4 years agosbin/fsck_msdosfs: u_int*_t -> uint*_t
Tomohiro Kusumi [Thu, 12 Sep 2019 13:04:05 +0000 (22:04 +0900)]
sbin/fsck_msdosfs: u_int*_t -> uint*_t

4 years agosbin/fsck_msdosfs: Whitespace cleanups
Tomohiro Kusumi [Thu, 12 Sep 2019 13:05:10 +0000 (22:05 +0900)]
sbin/fsck_msdosfs: Whitespace cleanups

4 years agodhcpcd(8): Add HAVE_IFADDRS_ADDRFLAGS to config.h
Roy Marples [Thu, 12 Sep 2019 09:41:45 +0000 (10:41 +0100)]
dhcpcd(8): Add HAVE_IFADDRS_ADDRFLAGS to config.h

As libc now has support for it.

4 years agogetifaddrs(3): Add ifa_addrflags to struct ifaddrs
Roy Marples [Thu, 12 Sep 2019 09:29:30 +0000 (10:29 +0100)]
getifaddrs(3): Add ifa_addrflags to struct ifaddrs

This saves a SIOCGIFAFLAG_IN6 ioctl per IPv6 address when
you're also interested in how useable the address is.

Taken-from: NetBSD

4 years agoroute(4): Add ifam_pid and ifam_addrflags to ifa_msghdr
Roy Marples [Thu, 12 Sep 2019 08:13:30 +0000 (09:13 +0100)]
route(4): Add ifam_pid and ifam_addrflags to ifa_msghdr

While here, re-arrange other route(4) message headers so the same
values appear in the same order for consistency.

Bump RTM_VERSION.

4 years agoshmctl.2: Refer to <sys/ipc.h> for the ipc_perm structure.
Sascha Wildner [Thu, 12 Sep 2019 08:07:00 +0000 (10:07 +0200)]
shmctl.2: Refer to <sys/ipc.h> for the ipc_perm structure.

4 years agomsgctl.2: Fix structure member name.
Sascha Wildner [Thu, 12 Sep 2019 08:05:22 +0000 (10:05 +0200)]
msgctl.2: Fix structure member name.

4 years agolibc/psignal: Minor sync with FreeBSD to adjust to int signum.
Sascha Wildner [Thu, 12 Sep 2019 07:11:36 +0000 (09:11 +0200)]
libc/psignal: Minor sync with FreeBSD to adjust to int signum.

4 years agolibc: Change psignal()'s signum argument from unsigned int to int.
Sascha Wildner [Thu, 12 Sep 2019 06:58:21 +0000 (08:58 +0200)]
libc: Change psignal()'s signum argument from unsigned int to int.

See https://pubs.opengroup.org/onlinepubs/9699919799/functions/psiginfo.html

4 years agodsynth - Add more make.conf variables
Matthew Dillon [Wed, 11 Sep 2019 19:28:42 +0000 (12:28 -0700)]
dsynth - Add more make.conf variables

* Add UID, AZRCH, OPSYS, DFLYVERSION, OSVERSION, OSREL,
  and _OSRELEASE.

Reported-by: tuxillo
4 years agobuild: Adjust _CMSG_ALIGN() for portability
Roy Marples [Wed, 11 Sep 2019 19:25:11 +0000 (20:25 +0100)]
build: Adjust _CMSG_ALIGN() for portability

Not every platform uses the same aligmnet, so use _ALIGNBYTES.
This an ABI break, but this is fine as there was already an ABI
break very recently.

ok: dillon

4 years agokern/pty: Fix comment to not name utmpx as reason for MAXPTYS == 1000.
Sascha Wildner [Wed, 11 Sep 2019 18:48:07 +0000 (20:48 +0200)]
kern/pty: Fix comment to not name utmpx as reason for MAXPTYS == 1000.

4 years agoat.1: Bump date.
Sascha Wildner [Wed, 11 Sep 2019 18:04:11 +0000 (20:04 +0200)]
at.1: Bump date.

4 years ago<unistd.h>: Declare intptr_t as per X/Open.
zrj [Wed, 11 Sep 2019 11:38:22 +0000 (14:38 +0300)]
<unistd.h>: Declare intptr_t as per X/Open.

 No functional change yet, for future reference.

4 years agolibdevattr: Remove not needed header include.
zrj [Wed, 11 Sep 2019 11:37:31 +0000 (14:37 +0300)]
libdevattr: Remove not needed header include.

 Nothing is needed from <sys/device.h> here.

4 years agolibc: Remove a single use of vm_offset_t type.
zrj [Wed, 11 Sep 2019 11:36:48 +0000 (14:36 +0300)]
libc: Remove a single use of vm_offset_t type.

 Use (uintptr_t) for casting (void *) like it is already used elsewhere
 for consistency.

 v2: use (uintptr_t) instead of (u_long) as suggested by swildner

4 years agolib: Remove no-op defines in CFLAGS for few libraries.
zrj [Wed, 11 Sep 2019 11:35:45 +0000 (14:35 +0300)]
lib: Remove no-op defines in CFLAGS for few libraries.

 No-op since 0d5acd7467c4e95f792ef49fceb3ab8e917ce86b.

4 years agolibc/locale: Limit visibility in private headers for tools.
zrj [Wed, 11 Sep 2019 11:34:36 +0000 (14:34 +0300)]
libc/locale: Limit visibility in private headers for tools.

 The localedef(1) requires just a few struct lc_*_t layouts from private
 lib/libc/locale/ headers in order to convert source definitions.
 It is desired that it uses as minimal as possible amount of internal
 header information, since localedef(1) is also in BTOOLS group.
 Same could be done to zic(8) and pwd_mkdb(8).

 * Use __LIBC guard to limit visibility in libc internal headers.
 * Poison xlocale_private.h to warn early that internals were used.

 Another issue is that localedef(1) and zic(8) are not recompiled on
 libc changes and require full BTOOLS recompile.  Converting both of
 them to hostprog would solve this, however there are invoke issues.

 No function change.

4 years agolibc: Add global __LIBC definition while building libc.
zrj [Wed, 11 Sep 2019 11:01:19 +0000 (14:01 +0300)]
libc: Add global __LIBC definition while building libc.

 It will be used to limit visibility for uses outside libc context.
 No functional change yet.

In-discussion-with: swilder

4 years agoAdjust numerous manual pages, scripts and Makefiles for the utmp removal.
Sascha Wildner [Wed, 11 Sep 2019 17:12:29 +0000 (19:12 +0200)]
Adjust numerous manual pages, scripts and Makefiles for the utmp removal.

Also remove /var/run/utmp and /var/log/lastlog via 'make upgrade'. Keep
any /var/log/wtmp and /var/log/wtmp.* files in case the user wants to
convert them with wtmpcvt(1).

4 years agoinet6: Restore ND6_LLINFO_WAITDELETE
Roy Marples [Wed, 11 Sep 2019 15:06:51 +0000 (16:06 +0100)]
inet6: Restore ND6_LLINFO_WAITDELETE

This predates DragonFlyBSD by quite a few years, but
ND6_LLINFO_WAITDELETE was removed in 2000 from all the BSD's.
This change brings it back so that if someone *really* wants
to resolve the unresolvable we don't constant delete
and add cloned routes which is just a waste of resources.

It also helps to return EHOSTDOWN more consistently to senders.
If we don't resolve the address during the normal wait cyckle OR
attempt to resolve it again while in the ND6_LLINFO_WAITDELETE
state, then then cloned route is then freed.

4 years agoinet6: Introduce nd6_resolve, the mirror of arpresolve
Roy Marples [Wed, 11 Sep 2019 13:01:08 +0000 (14:01 +0100)]
inet6: Introduce nd6_resolve, the mirror of arpresolve

nd6_output now just sends the packet, nd6_resolve handles the NUD
that nd6_output used to. nd6_resolve also returns sensible errors,
but we mask out EWOULDBLOCK in the callers.

There is no longer a need for nd6_storelladdr and this makes the
code a lot easier to follow.

Heavily inspired by FreeBSD/Git 49332534.

4 years agotelnetd(8): Fix a warning and bump WARNS to 5.
Sascha Wildner [Tue, 10 Sep 2019 19:32:36 +0000 (21:32 +0200)]
telnetd(8): Fix a warning and bump WARNS to 5.

4 years agoAdd a wtmpcvt(1) utility from FreeBSD to convert wtmp -> wtmpx.
Sascha Wildner [Tue, 10 Sep 2019 19:31:50 +0000 (21:31 +0200)]
Add a wtmpcvt(1) utility from FreeBSD to convert wtmp -> wtmpx.