dragonfly.git
12 months 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).

12 months 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

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

12 months 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.

12 months 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.

12 months 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))

12 months 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)

12 months 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))

12 months 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)

12 months 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)

12 months 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())

12 months 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.

12 months 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

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

12 months 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.

12 months 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

12 months 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.

12 months 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.

12 months 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.

12 months 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.

12 months 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

12 months 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
12 months 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

12 months 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.

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

12 months 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.

12 months 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.

12 months 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

12 months 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.

12 months 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.

12 months 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

12 months 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).

12 months 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.

12 months 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.

12 months 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.

12 months 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.

12 months agoRetire the utmp specific ttyslot() function, like FreeBSD did.
Sascha Wildner [Tue, 10 Sep 2019 19:30:00 +0000 (21:30 +0200)]
Retire the utmp specific ttyslot() function, like FreeBSD did.

12 months agoRemove the legacy "utmp" API, now that our utils have been moved to utmpx.
Sascha Wildner [Tue, 10 Sep 2019 19:26:48 +0000 (21:26 +0200)]
Remove the legacy "utmp" API, now that our utils have been moved to utmpx.

As I wrote in UPGRADING, the main change for "normal" users is probably
that /var/log/wtmp is no longer logged to, just /var/log/wtmpx.

Leave the old API in libc as compat symbols that do nothing and always
succeed for the run-time linker (i.e. old binaries still using them).

dports has been kindly adjusted by zrj and new binary packages for master
are on their way.

A future commit will provide a wtmpcvt(1) utility to convert old wtmp
files to the wtmpx format.

12 months agoac(8): Sync with FreeBSD, i.e. switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 19:13:52 +0000 (21:13 +0200)]
ac(8): Sync with FreeBSD, i.e. switch to utmpx. Drop utmp support.

12 months agoftpd(8): Add utmpx support from FreeBSD. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 19:10:23 +0000 (21:10 +0200)]
ftpd(8): Add utmpx support from FreeBSD. Drop utmp support.

12 months agorwhod(8): Add utmpx support from FreeBSD. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 19:09:25 +0000 (21:09 +0200)]
rwhod(8): Add utmpx support from FreeBSD. Drop utmp support.

12 months agoppp(8): Add utmpx support from FreeBSD. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 19:07:59 +0000 (21:07 +0200)]
ppp(8): Add utmpx support from FreeBSD. Drop utmp support.

12 months agowho(1)/finger(1): Move to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 19:06:24 +0000 (21:06 +0200)]
who(1)/finger(1): Move to utmpx. Drop utmp support.

finger(1) utmpx support taken from FreeBSD.

This also moves the consumers of utmpentry.c to utmpx: talkd(8),
systat(1), users(1), wall(1) and write(1).

12 months agorpc.rusersd(8): Sync with FreeBSD, i.e. switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 19:05:03 +0000 (21:05 +0200)]
rpc.rusersd(8): Sync with FreeBSD, i.e. switch to utmpx. Drop utmp support.

12 months agocomsat(8): Sync with FreeBSD, i.e. switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 19:01:31 +0000 (21:01 +0200)]
comsat(8): Sync with FreeBSD, i.e. switch to utmpx. Drop utmp support.

12 months agosshd(8): Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:59:44 +0000 (20:59 +0200)]
sshd(8): Drop utmp support.

12 months agocsh(1): Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:58:32 +0000 (20:58 +0200)]
csh(1): Drop utmp support.

12 months agoreboot(8): Switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:57:23 +0000 (20:57 +0200)]
reboot(8): Switch to utmpx. Drop utmp support.

12 months agopam_lastlog(8): Switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:56:06 +0000 (20:56 +0200)]
pam_lastlog(8): Switch to utmpx. Drop utmp support.

12 months agotelnetd(8): Switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:44:30 +0000 (20:44 +0200)]
telnetd(8): Switch to utmpx. Drop utmp support.

12 months agow(1): Switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:41:02 +0000 (20:41 +0200)]
w(1): Switch to utmpx. Drop utmp support.

12 months agoinit(8): Switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:40:03 +0000 (20:40 +0200)]
init(8): Switch to utmpx. Drop utmp support.

12 months agolastlogin(8): Switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:36:44 +0000 (20:36 +0200)]
lastlogin(8): Switch to utmpx. Drop utmp support.

12 months agolast(1): Fix wrong shutdown/reboot reporting.
Sascha Wildner [Tue, 10 Sep 2019 18:24:03 +0000 (20:24 +0200)]
last(1): Fix wrong shutdown/reboot reporting.

Our last was reporting shutdown/reboot as crashes and it has something
to do with our order of wtmpx log entries vs. NetBSD's. This should be
revisited later. For now, take the "reboot" entry into account too.

12 months agolast(1): Switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:22:32 +0000 (20:22 +0200)]
last(1): Switch to utmpx. Drop utmp support.

While here, merge what remains of want.c into last.c.

12 months agodate(1): Switch to utmpx. Drop utmp support.
Sascha Wildner [Tue, 10 Sep 2019 18:20:44 +0000 (20:20 +0200)]
date(1): Switch to utmpx. Drop utmp support.

12 months agolibc: Add getutxuser() (adapted from FreeBSD).
Sascha Wildner [Tue, 10 Sep 2019 18:20:04 +0000 (20:20 +0200)]
libc: Add getutxuser() (adapted from FreeBSD).

12 months agoRemove 'register' qualifier
Matthew Dillon [Tue, 10 Sep 2019 16:51:20 +0000 (09:51 -0700)]
Remove 'register' qualifier

* Not allowed in c++17, and no longer has any usefulness
  given that modern compilers already optimize variables
  into registers extremely well.

Reported-by: zrj
12 months agosbin/mount_msdos: Bring in FreeBSD/Git 0c5ae3a9 (add -M option)
Tomohiro Kusumi [Tue, 10 Sep 2019 15:06:26 +0000 (00:06 +0900)]
sbin/mount_msdos: Bring in FreeBSD/Git 0c5ae3a9 (add -M option)

12 months agorc.d/dhcpcd: Start before netif
Roy Marples [Tue, 10 Sep 2019 14:34:57 +0000 (15:34 +0100)]
rc.d/dhcpcd: Start before netif

This ensures that in the silly case where dhcpcd is enabled
AND ifconfig_foo=DHCP is set then a second dhcpcd instance is not
started.

12 months agosys/net: Rename if_route_dispatch to if_up_dispatch
Roy Marples [Tue, 10 Sep 2019 14:02:03 +0000 (15:02 +0100)]
sys/net: Rename if_route_dispatch to if_up_dispatch

The word route here is misleading and is heavily influenced with
the addition of removed subnet routes when taken down which is
no longer the case.
While here, remove pointless flag and family from the message
object.

Do the same for unroute.

12 months agonet/if_gre: unhook rip_ctlinput
Roy Marples [Tue, 10 Sep 2019 13:32:54 +0000 (14:32 +0100)]
net/if_gre: unhook rip_ctlinput

It no longer exists, see prior commit.

12 months agosbin/mount_msdos: Bring in FreeBSD/Git 7e476e89
Tomohiro Kusumi [Tue, 10 Sep 2019 14:11:04 +0000 (23:11 +0900)]
sbin/mount_msdos: Bring in FreeBSD/Git 7e476e89

12 months agosbin/mount_msdos: Whitespace cleanups
Tomohiro Kusumi [Tue, 10 Sep 2019 14:14:38 +0000 (23:14 +0900)]
sbin/mount_msdos: Whitespace cleanups

12 months agoinet: unhook and remove rip_ctlinput
Roy Marples [Tue, 10 Sep 2019 12:42:19 +0000 (13:42 +0100)]
inet: unhook and remove rip_ctlinput

This is no longer needed thanks to rt_purgecloned.
This also fixes two problems where we would lie about the address
being removed via RTM_DELADDR and the assumption that the
subnet route should be removed / moved to another interface.

12 months agoinet: hookup in6_if_down with rt_purgecloned
Roy Marples [Tue, 10 Sep 2019 12:39:22 +0000 (13:39 +0100)]
inet: hookup in6_if_down with rt_purgecloned

12 months agoinet: hookup in_if_down with rt_purgecloned
Roy Marples [Tue, 10 Sep 2019 12:37:43 +0000 (13:37 +0100)]
inet: hookup in_if_down with rt_purgecloned

12 months agoroute: introduce rt_purgecloned
Roy Marples [Tue, 10 Sep 2019 12:35:40 +0000 (13:35 +0100)]
route: introduce rt_purgecloned

This function walks the route tree for the given address family
and deleted any cloned route for the given interface.

12 months agosys/net: Call in6_if_up from the domain rather than directly
Roy Marples [Tue, 10 Sep 2019 11:16:52 +0000 (12:16 +0100)]
sys/net: Call in6_if_up from the domain rather than directly

12 months agosys/net: Add dom_if_up and dom_if_down
Roy Marples [Tue, 10 Sep 2019 11:09:20 +0000 (12:09 +0100)]
sys/net: Add dom_if_up and dom_if_down

Domain functions for when the interface goes up and down.

12 months agoroute: Don't install a cloned route when interface is down
Roy Marples [Tue, 10 Sep 2019 11:00:36 +0000 (12:00 +0100)]
route: Don't install a cloned route when interface is down

When an interface is taken down, all subnet routes are removed
and thus all cloned routes are flushed.

It's possible, although unlikely, for userland to add a subnet
route when the interface is down.

In this state, EHOSTDOWN would be returned regardless, but a
cloned route would be created locked to the interface.
Instead, check if interface is down before creating the cloned
route so it's not made needlessly.

12 months ago<netinet/in_var.h>: Adjust visibility.
zrj [Sat, 31 Aug 2019 14:12:33 +0000 (17:12 +0300)]
<netinet/in_var.h>: Adjust visibility.

 It appears that only struct in_ifaddr and in_aliasreq need to be exposed
 to the userland.

 While there, disable two macros that do not seem to be used by DPorts.

12 months ago<netinet/in_var.h>: Include sys/fnv_hash.h only for _KERNEL.
zrj [Sat, 31 Aug 2019 13:06:25 +0000 (16:06 +0300)]
<netinet/in_var.h>: Include sys/fnv_hash.h only for _KERNEL.

 Many dports have their own hash-32.c and hash-fnv.cc implementations.
 This makes the lib/libkvm/kvm_minidump_x86_64.c the only consumer of
 <sys/fnv_hash.h> in userland.

12 months ago<sys/fnv_hash.h>: Remove unused fnv_64*() inline functions.
zrj [Sat, 31 Aug 2019 11:58:37 +0000 (14:58 +0300)]
<sys/fnv_hash.h>: Remove unused fnv_64*() inline functions.

 Unused in base (neither OpenBSD or NetBSD has this header).  Once needed
 64 variants can be added from www.isthe.com/chongo/src/fnv/hash_64.c
 For now keep fnv_32_str() inline, but disable it.  It could be used in
 several kernel places instead of fnv_32_buf().  The smbfs_hash() in
 sys/vfs/smbfs/smbfs_node.c could be adjusted to use <sys/fnv_hash.h>.

 Reduces kernel.stripped size by 72 bytes.

12 months ago<sys/dmsg.h>: Reduce userland namespace pollution.
zrj [Sat, 31 Aug 2019 09:54:15 +0000 (12:54 +0300)]
<sys/dmsg.h>: Reduce userland namespace pollution.

 Do not include <sys/malloc.h> and <sys/thread.h> for userland here.
 This removes dependencies on these headers for all dmsg consumers like:
  fstyp(8), hammer2(8), mount_hammer2(8), newfs_hammer2(8) and libstand
 which is desired in standalone boot environment.
 Add missing <machine/param.h> for libstand/hammer2.c that needs the
 DEV_BSHIFT definition, previously it was visible through <sys/malloc.h>
 namespace pollution.

 While there, mark some guards for clarity too.

 Noticed while investigating .depend â€‹violations.

12 months ago<sys/device.h>: Adjust userland visibility.
zrj [Sat, 31 Aug 2019 09:51:34 +0000 (12:51 +0300)]
<sys/device.h>: Adjust userland visibility.

 While there, do the same to sys/devfs.h and sys/vfsops.h.

 No functional change for base.

12 months ago<sys/device.h>: Disable some no longer used types.
zrj [Sat, 31 Aug 2019 09:47:37 +0000 (12:47 +0300)]
<sys/device.h>: Disable some no longer used types.

 Some additional cleanup in sys/devfs.h and sys/vfsops.h:
 * dev_args_union/vop_args_union unused since introduced in
   fef8985e09e16aeee4a2014876e2e4b758656ac2 and
   2d3e977e265c8a4a48b58061b9d91ad235ed2265
 * devfs_unit_hash unused since 898c91ee87ff48eab03bcce3add7afc16a58754e
 * D_NAGGED unused since 335dda388a5c13edd38c87c32b72e51eaaedce75
 * DEVFS_ISDIGIT unused since 07dfa375a25f4ef43c956ee33c739661306f601

 While there, minor trailing whitespace cleanup in sys/vfsops.h.

12 months ago<cpu/param.h>: Change visibility for several macros.
zrj [Sat, 31 Aug 2019 09:46:16 +0000 (12:46 +0300)]
<cpu/param.h>: Change visibility for several macros.

 While there, remove two unused ones since introduced in
 c8fe38ae0761c8117b13caf9b76ad5fb86ac2135

12 months agokernel: Remove kvtop() remnant form early x86_64 port.
zrj [Sat, 31 Aug 2019 09:45:16 +0000 (12:45 +0300)]
kernel: Remove kvtop() remnant form early x86_64 port.

12 months agoplatform/pc64: Remove unused pte_store() and pde_store().
zrj [Sat, 31 Aug 2019 09:44:33 +0000 (12:44 +0300)]
platform/pc64: Remove unused pte_store() and pde_store().

 Never used since introduced in 48ffc2362a11e481bf0398dc7ce5e4815acd2190

12 months ago<machine/param.h>: Remove unused KSTACK_PAGES.
zrj [Sat, 31 Aug 2019 09:43:29 +0000 (12:43 +0300)]
<machine/param.h>: Remove unused KSTACK_PAGES.

 Unused since 4611d87f91be625f8ef4c7ea2709b86abe035b65

12 months ago<sys/serialize.h>: Limit prototypes to kernel only.
zrj [Sat, 31 Aug 2019 09:42:07 +0000 (12:42 +0300)]
<sys/serialize.h>: Limit prototypes to kernel only.

 The "struct lwkt_serialize" must be left userland visible for if_net.

12 months ago<sys/jail.h>: Use forward declarations for private members.
zrj [Sat, 31 Aug 2019 09:40:42 +0000 (12:40 +0300)]
<sys/jail.h>: Use forward declarations for private members.

 This reduces dependencies on <sys/sysctl.h> in both kernel and userland.

12 months agolibc: Add gets_s(3) from ISO/IEC TR 24731-1.
Sascha Wildner [Mon, 9 Sep 2019 17:44:47 +0000 (19:44 +0200)]
libc: Add gets_s(3) from ISO/IEC TR 24731-1.

For more information see the Technical Report (drafts of it are on
the web) or e.g. http://en.cppreference.com/w/c/io/gets.

This also adds set_constraint_handler_s(), abort_handler_s(),
ignore_handler_s(), the RSIZE_MAX define, and the types rsize_t,
errno_t and constraint_handler_t.

Visibility is restricted to our default environment by default, but
can be enabled by defining __STDC_WANT_LIB_EXT1__ to 1, per the TR.

While here, put gets()'s documentation into a manual page of its own
with a note that it is depracated. We'll likely remove it from libc
too at a later point in time.

Requested-by: zrj
Taken-from:   FreeBSD (with some adjustments)

12 months ago<sys/cdefs.h>: Add a macro to control ISO/IEC TR 24731-1 visibility.
Sascha Wildner [Sun, 8 Sep 2019 10:28:54 +0000 (12:28 +0200)]
<sys/cdefs.h>: Add a macro to control ISO/IEC TR 24731-1 visibility.

The __STDC_WANT_LIB_EXT1__ macro controls visibility for code that
wants to use it. In addition, visibility is enabled for our default
environment that exposes everything.

Taken-from: FreeBSD

12 months agoinet: return EHOSTDOWN if we cannot resolve an address in time
Roy Marples [Mon, 9 Sep 2019 16:48:11 +0000 (17:48 +0100)]
inet: return EHOSTDOWN if we cannot resolve an address in time

This allows programs to make informed decisions about what to do
if anything goes wrong trying to resolve the address.

For example, ping(8) now reports sendto: Host is down, which is
more useful than not reporting anything.

Taken-from: NetBSD

12 months agoinet: Don't mark cloned route as RTF_REJECT on RTM_MISS
Roy Marples [Mon, 9 Sep 2019 16:20:29 +0000 (17:20 +0100)]
inet: Don't mark cloned route as RTF_REJECT on RTM_MISS

With the current behaviour, the cloned route is marked as
RTF_REJECT which means subsequent use is delayed until either an
ARP reply comes in or the ARP entry times out and resolution
can then begin again.

Instead, no longer mark the route for RTF_REJECT and allow more
ARP requests to go out if something really wants to use it.
This mirror the current behaviour for inet6.

12 months agosbin/newfs_msdos: Bring in -A/-T options from FreeBSD
Tomohiro Kusumi [Sun, 8 Sep 2019 00:19:12 +0000 (09:19 +0900)]
sbin/newfs_msdos: Bring in -A/-T options from FreeBSD

Basically from FreeBSD/Git 284893ba and 8255b708.

12 months agonewfs_msdos.8: Re-fix typo. :)
Sascha Wildner [Mon, 9 Sep 2019 11:07:04 +0000 (13:07 +0200)]
newfs_msdos.8: Re-fix typo. :)

12 months agosbin/newfs_msdos: Sync newfs_msdos.8 with FreeBSD
Tomohiro Kusumi [Mon, 9 Sep 2019 01:19:43 +0000 (10:19 +0900)]
sbin/newfs_msdos: Sync newfs_msdos.8 with FreeBSD

12 months agosbin/newfs_msdos: Bring in FreeBSD/Git 47266d91, b25a2bc0
Tomohiro Kusumi [Mon, 9 Sep 2019 01:02:22 +0000 (10:02 +0900)]
sbin/newfs_msdos: Bring in FreeBSD/Git 47266d91b25a2bc0

12 months agosys/vfs/msdosfs: Bring back EXBOOTSIG2 (unbreak lib/libfsid build)
Tomohiro Kusumi [Sun, 8 Sep 2019 18:36:43 +0000 (03:36 +0900)]
sys/vfs/msdosfs: Bring back EXBOOTSIG2 (unbreak lib/libfsid build)

Note that fatgen103 doesn't mention such thing.
FreeBSD/NetBSD don't have it either.

12 months agoopenresolv: correct README
Roy Marples [Sun, 8 Sep 2019 21:56:42 +0000 (22:56 +0100)]
openresolv: correct README

12 months agoresolvconf: We need the onestatus argument
Roy Marples [Sun, 8 Sep 2019 21:25:36 +0000 (22:25 +0100)]
resolvconf: We need the onestatus argument

As status suffers the same flaw as FreeBSD.
Namely it returns 0 if not running AND not enabled.

12 months agoopenresolv: Update README
Roy Marples [Sun, 8 Sep 2019 21:23:49 +0000 (22:23 +0100)]
openresolv: Update README

12 months agoMerge branch 'vendor/OPENRESOLV' with the following changes:
Roy Marples [Sun, 8 Sep 2019 21:15:16 +0000 (22:15 +0100)]
Merge branch 'vendor/OPENRESOLV' with the following changes:
  *  dnsmasq: clear cache after updating servers via dbus
  *  pdns_recursor: Fix global forwards (thus now installed by default)
  *  man: layout and misc fixes

12 months agoImport openresolv-3.9.2 to vendor branch. vendor/OPENRESOLV
Roy Marples [Sun, 8 Sep 2019 21:11:05 +0000 (22:11 +0100)]
Import openresolv-3.9.2 to vendor branch.

12 months agosbin/newfs_msdos: Bring in FreeBSD/Git 902f77041b477be4d9d99608b463be01ac7611ea
Tomohiro Kusumi [Sun, 8 Sep 2019 18:08:08 +0000 (03:08 +0900)]
sbin/newfs_msdos: Bring in FreeBSD/Git 902f77041b477be4d9d99608b463be01ac7611ea

Invalidate FSI_Nxt_Free hint in FSInfo for FAT32.

12 months agosys/vfs/msdosfs: Sync with FreeBSD (non functional diffs)
Tomohiro Kusumi [Sat, 7 Sep 2019 17:33:01 +0000 (02:33 +0900)]
sys/vfs/msdosfs: Sync with FreeBSD (non functional diffs)

12 months agoroute: Seperate route messages from creation/lookup.
Roy Marples [Sun, 8 Sep 2019 10:56:18 +0000 (11:56 +0100)]
route: Seperate route messages from creation/lookup.

This allows a more fine grained choice about whether to announce
messsages via route(4) or not.

For example, a freshly added clone route is useless without the
resolved hardware address it's talking to.
Instead, announce the route when the hardware address has
been resolved, changed or if it's not resolvable.

For IPv6 destinations, we can now interpret RTM_MISS as unreachable.
This allows listening software to take action, such as soliciting
a new router if the destination missed was originally a router.

Reviewed-by: sephe