git: DragonFly_RELEASE_5_2 nrelease/Makefile: Fix to use GITURL_{SRC, DPORTS} and update help

2018-06-08 Thread Aaron LI


commit 60654128f150954bc0f3f837c229b5d5ecf18dff
Author: Aaron LI 
Date:   Fri Jun 8 15:58:47 2018 +0800

nrelease/Makefile: Fix to use GITURL_{SRC,DPORTS} and update help

The GITHOST and GITHOST_DPORTS were updated to be GITURL_SRC and 
GITURL_DPORTS
in ad8b70e08d7600e3f4eb3b36556d4540b1a9c119.

Summary of changes:
 nrelease/Makefile | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/60654128f150954bc0f3f837c229b5d5ecf18dff


-- 
DragonFly BSD source repository


git: README: Remove the secure entry; add the doc entry.

2018-06-08 Thread Aaron LI


commit b224b70ed7e311123db802d9e76505c70566e9a1
Author: Aaron LI 
Date:   Fri Jun 1 12:46:21 2018 +0800

README: Remove the secure entry; add the doc entry.

Those contents resided under secure were merged into crypto some time ago.

Summary of changes:
 README | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b224b70ed7e311123db802d9e76505c70566e9a1


-- 
DragonFly BSD source repository


git: etc/crontab: Do not set HOME; remove /etc from PATH

2018-06-08 Thread Aaron LI


commit be4f6be01c03e8cba9e937ca117d95a59f709343
Author: Aaron LI 
Date:   Fri Jun 1 12:49:41 2018 +0800

etc/crontab: Do not set HOME; remove /etc from PATH

Do not set the HOME environment variable (checked with FreeBSD).

Remove "/etc" from PATH (checked with OpenBSD).

Summary of changes:
 etc/crontab | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/be4f6be01c03e8cba9e937ca117d95a59f709343


-- 
DragonFly BSD source repository


git: README: Update descriptions to sys/config files

2018-06-08 Thread Aaron LI


commit 6dfa5e2f7c6d51dd446334a68b911d0f0c0a53d7
Author: Aaron LI 
Date:   Fri Jun 1 12:47:58 2018 +0800

README: Update descriptions to sys/config files

Summary of changes:
 README | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6dfa5e2f7c6d51dd446334a68b911d0f0c0a53d7


-- 
DragonFly BSD source repository


git: mk/crunchgen: Fix the ${MAKE} quotation and improve style

2018-06-08 Thread Aaron LI


commit df820087d62ba7fa38c40615f9f8e6e5a751d839
Author: Aaron LI 
Date:   Fri Jun 1 13:06:22 2018 +0800

mk/crunchgen: Fix the ${MAKE} quotation and improve style

The fix to the ${MAKE} quotation is brought from FreeBSD.

Various style fixes to make this makefile look much cleaner.

Summary of changes:
 share/mk/bsd.crunchgen.mk | 54 +--
 1 file changed, 24 insertions(+), 30 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/df820087d62ba7fa38c40615f9f8e6e5a751d839


-- 
DragonFly BSD source repository


git: initrd: symlink tmp to var/tmp to save a second tmpfs mount

2018-06-08 Thread Aaron LI


commit 2c6b09fdbe57f3e43b56cb5e7d8fc589aa70c0b0
Author: Aaron LI 
Date:   Fri Jun 1 14:57:37 2018 +0800

initrd: symlink tmp to var/tmp to save a second tmpfs mount

Since a tmpfs is required to mount at /var in the initrd, symlink /tmp to
/var/tmp to save a second tmpfs mount.

Add /mnt to the initrd hierarchy, which may be used by the user to manually
mount filesystems.  (Suggested-by: zrj)

Summary of changes:
 etc/defaults/mkinitrd.conf | 4 +++-
 sbin/mkinitrd/mkinitrd.sh  | 9 +++--
 2 files changed, 10 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2c6b09fdbe57f3e43b56cb5e7d8fc589aa70c0b0


-- 
DragonFly BSD source repository


git: initrd: Make etc/motd more informative

2018-06-08 Thread Aaron LI


commit fa8f1016ba7a7a1aca1f77c6fa6b838fabdb774e
Author: Aaron LI 
Date:   Fri Jun 1 14:08:57 2018 +0800

initrd: Make etc/motd more informative

Provide more information about the rescue shell environment, such as how to
mount the real root partition and continue, the mined editor, and more on
network connections.

Summary of changes:
 share/initrd/etc/motd | 17 ++---
 1 file changed, 14 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/fa8f1016ba7a7a1aca1f77c6fa6b838fabdb774e


-- 
DragonFly BSD source repository


git: mkinitrd(8): Use getopts instead of getopt(1) for command options

2018-06-08 Thread Aaron LI


commit e6d2b207c86b3715f2b17a04525b97d722da1a78
Author: Aaron LI 
Date:   Fri Jun 1 15:48:13 2018 +0800

mkinitrd(8): Use getopts instead of getopt(1) for command options

Use the shell built-in getopts to deal with command line options, which is
more easier to use and allows whitespace in the option values.

Summary of changes:
 sbin/mkinitrd/mkinitrd.sh | 51 ++-
 1 file changed, 37 insertions(+), 14 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e6d2b207c86b3715f2b17a04525b97d722da1a78


-- 
DragonFly BSD source repository


git: etc/Makefile: Do not install rc.firewall as executable

2018-06-08 Thread Aaron LI


commit af0aa05239550f7ac7afbaf1fd762233c113c290
Author: Aaron LI 
Date:   Fri Jun 1 12:19:07 2018 +0800

etc/Makefile: Do not install rc.firewall as executable

/etc/rc.firewall doesn't need to be installed as executable, similar to
/etc/rc.firewall6 .

Summary of changes:
 etc/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/af0aa05239550f7ac7afbaf1fd762233c113c290


-- 
DragonFly BSD source repository


git: initrd/rc: mount initrd ro; set PATH, HOME, NEW_ROOT; cleanups

2018-06-08 Thread Aaron LI


commit bffbc0686a965d67b3c33dbd3eab87e7df313aa0
Author: Aaron LI 
Date:   Fri Jun 1 15:14:27 2018 +0800

initrd/rc: mount initrd ro; set PATH, HOME, NEW_ROOT; cleanups

* The initrd is mounted readonly by default, do not upgrade to be readwrite.

  NOTE: This may cause problem with diskless boot (/etc/rc.d/diskless) and
  needs further tests and tunes (Thanks to ftigeot).

* Set PATH=/bin:/sbin to simplify the command invocations.

* Set HOME=/var/home (Suggested-by: ftigeot)

* Set NEW_ROOT=/new_root that will be used in the mount scripts.

  Make sure that the NEW_ROOT directory exist, otherwise try to remount the
  initrd / readwrite and create it.

* Various cleanups to make it much simpler and cleaner.

* Also clean up the rc.lvm2 a bit.

Summary of changes:
 share/initrd/etc/rc  | 64 
 share/initrd/etc/rc.lvm2 | 12 -
 2 files changed, 37 insertions(+), 39 deletions(-)
 mode change 100755 => 100644 share/initrd/etc/rc
 mode change 100755 => 100644 share/initrd/etc/rc.lvm2

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bffbc0686a965d67b3c33dbd3eab87e7df313aa0


-- 
DragonFly BSD source repository


git: nrelease/Makefile: Fix to use GITURL_{SRC, DPORTS} and update help

2018-06-08 Thread Aaron LI


commit 8126e4ef69615a815a2767b95b8f7b934ca1e56d
Author: Aaron LI 
Date:   Fri Jun 8 15:58:47 2018 +0800

nrelease/Makefile: Fix to use GITURL_{SRC,DPORTS} and update help

The GITHOST and GITHOST_DPORTS were updated to be GITURL_SRC and 
GITURL_DPORTS
in ad8b70e08d7600e3f4eb3b36556d4540b1a9c119.

Summary of changes:
 nrelease/Makefile | 32 
 1 file changed, 16 insertions(+), 16 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8126e4ef69615a815a2767b95b8f7b934ca1e56d


-- 
DragonFly BSD source repository


git: initrd: Detach from the world and build on the fly

2018-06-08 Thread Aaron LI


commit e79a303f7db7331d570bb6c6abdd555eeefdcdc2
Author: Aaron LI 
Date:   Sat Jun 2 13:31:45 2018 +0800

initrd: Detach from the world and build on the fly

Why
---
Currently, the files for initrd image creation are built and installed at
/usr/share/initrd by "buildworld" and "installworld", respectively, and then
mkinitrd(8) simply packs them to create the initrd.img.gz.

For normal users, the shipped /usr/share/initrd and mkinitrd(8) don't make
much sense, since they don't need to modify the initrd contents and create
a modified initrd image.

From a developer's perspective, the required steps (buildworld, installworld
and mkinitrd) to create and test a new initrd image can be annoying.

How
---
Detach the build and installation of the initrd contents from the world.
Build the (rescue/initrd) tools on-the-fly when creating the initrd image.

As per ftigeot's suggestion, these statically linked tools can be useful 
when
dealing with a broken system, so install them under /rescue to be more
intuitive and easier to use (similar to FreeBSD and maybe other BSDs).

What

* Move "share/initrd" to be top-level, and detach it from world.

  + Update the patch in bsd.crunchgen.mk accordingly.
  + Add Makefile.inc to simplify subdir's makefiles.
  + Rewrite the Makefile with targets:
- rescue: build and install the rescue tools into /rescue.
- initrd: further packs the etc and rescue staffs to create the initrd
  image.

* Move "sbin/mkinitrd/mkinitrd.sh" under the new "initrd" directory and 
adapt
  it to work with the "initrd" make target.  Remove the other parts of
  mkinitrd(8).

* Export the above "rescue" and "initrd" targets to be top-level.

* Update nrelease framework to use the new "make initrd".

* Update build.7 man page accordingly.

* Print the message about updating the initrd image and 3rd-party packages
  after "make upgrade" instead of "make installworld".

* Document this change in UPDATING.

* Other small updates and style cleanups.

TODO

* Add initrd.7 man page
* Crunch more useful tools
* Crunch bin/sbin/etc. into a bundle to save space (??)

Reviewed-by: swildner
Thanks-to: dillon, swildner, ftigeot

Summary of changes:
 Makefile   |  33 ++-
 Makefile.inc1  |  11 -
 Makefile_upgrade.inc   |   5 +
 README |   3 +
 UPDATING   |   8 +
 etc/Makefile   |   2 +-
 etc/mtree/BSD.root.dist|   2 +
 etc/mtree/BSD.usr.dist |   8 -
 initrd/Makefile|  30 +++
 initrd/Makefile.inc|   8 +
 {share/initrd => initrd}/bin/Makefile  |   5 -
 {share/initrd => initrd}/bin/dowpa |   2 +-
 initrd/etc/Makefile|  24 ++
 {share/initrd => initrd}/etc/motd  |   0
 {share/initrd => initrd}/etc/rc|   0
 {share/initrd => initrd}/etc/rc.lvm2   |   0
 {share/initrd => initrd}/etc/rcmount_crypt |   0
 {share/initrd => initrd}/etc/rcmount_tcplay|   0
 initrd/mkinitrd.sh | 295 +
 {share/initrd/mini_init => initrd/oinit}/Makefile  |   5 -
 {share/initrd/mini_init => initrd/oinit}/oinit.c   |  10 +-
 .../initrd/mini_init => initrd/oinit}/pathnames.h  |   3 +-
 {share/initrd => initrd}/sbin.libcrypto/Makefile   |   7 +-
 {share/initrd => initrd}/sbin.lvm/Makefile |   9 +-
 {share/initrd => initrd}/sbin/Makefile |   7 +-
 nrelease/Makefile  |  20 +-
 sbin/Makefile  |   1 -
 sbin/mkinitrd/Makefile |   5 -
 sbin/mkinitrd/mkinitrd.8   | 189 -
 sbin/mkinitrd/mkinitrd.sh  | 240 -
 share/Makefile |  27 +-
 share/initrd/Makefile  |   3 -
 share/initrd/etc/Makefile  |  33 ---
 share/man/man7/build.7 |  17 +-
 share/mk/bsd.crunchgen.mk  |   2 +-
 35 files changed, 453 insertions(+), 561 deletions(-)
 create mode 100644 initrd/Makefile
 create mode 100644 initrd/Makefile.inc
 rename {share/initrd => initrd}/bin/Makefile (95%)
 rename {share/initrd => initrd}/bin/dowpa (90%)
 create mode

git: hammer2: do not print error=0x0000 on bulkfree

2018-06-08 Thread Aaron LI


commit 746bb04f7f7f1ec434bb18a3463c910eb6fc7f4d
Author: Aaron LI 
Date:   Fri Jun 1 12:09:59 2018 +0800

hammer2: do not print error=0x on bulkfree

Make hammer2 bulkfree do not print "error=0x" (i.e., no error occurred).
This makes the system log messages (/var/log/messages) a bit cleaner.

Fix minor whitespace issues as well.

Summary of changes:
 sys/vfs/hammer2/hammer2_bulkfree.c | 29 -
 1 file changed, 16 insertions(+), 13 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/746bb04f7f7f1ec434bb18a3463c910eb6fc7f4d


-- 
DragonFly BSD source repository


git: Makefile{, .inc1}: Merge user-driven target descriptions and cleanups

2018-06-08 Thread Aaron LI


commit f71956f75f646783a438957a0c60e142bbb8725d
Author: Aaron LI 
Date:   Sat Jun 2 13:09:19 2018 +0800

Makefile{,.inc1}: Merge user-driven target descriptions and cleanups

* Merge the descriptions to user-driven targets from Makefile.inc1 to
  Makefile and improve the wordings a bit.

* Delete some obsolete information.

* Whitespace cleanups.

Summary of changes:
 Makefile  | 54 +-
 Makefile.inc1 | 39 +++
 2 files changed, 36 insertions(+), 57 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f71956f75f646783a438957a0c60e142bbb8725d


-- 
DragonFly BSD source repository


git: periodic: return $rc instead of "$rc" for several scripts

2018-06-08 Thread Aaron LI


commit 93d00c83db6186c0fc528c1a7c3ca9c215444c94
Author: Aaron LI 
Date:   Fri Jun 1 12:56:05 2018 +0800

periodic: return $rc instead of "$rc" for several scripts

Also fix a minor whitespace issue in 200.chkmounts .

Summary of changes:
 etc/periodic/security/200.chkmounts  | 4 ++--
 etc/periodic/security/300.chkuid0| 2 +-
 etc/periodic/security/400.passwdless | 2 +-
 etc/periodic/security/410.logincheck | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/93d00c83db6186c0fc528c1a7c3ca9c215444c94


-- 
DragonFly BSD source repository


git: initrd: don't leave an empty /rescue after switching location

2018-06-09 Thread Aaron LI


commit 111cbfe4120e75ea2a4ae370743107616748cd43
Author: Aaron LI 
Date:   Sat Jun 9 16:45:48 2018 +0800

initrd: don't leave an empty /rescue after switching location

The recent initrd change will remove the rescue tools from their old
location (/usr/share/initrd) but leave an empty /rescue directory.  Avoid
such a situation by building the rescue tools after installworld if /rescue
is empty.

Suggested-by: François Tigeot

Summary of changes:
 Makefile.inc1 | 10 ++
 1 file changed, 10 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/111cbfe4120e75ea2a4ae370743107616748cd43


-- 
DragonFly BSD source repository


git: mk/prog: Support CRUNCH_CFLAGS for crunchgen's buildopts

2018-07-01 Thread Aaron LI


commit af6593369b649c4cbafba7e13d587c9fb8857ace
Author: Aaron LI 
Date:   Sat Jun 9 19:22:14 2018 +0800

mk/prog: Support CRUNCH_CFLAGS for crunchgen's buildopts

Taken-from: FreeBSD

Summary of changes:
 share/mk/bsd.prog.mk | 4 
 1 file changed, 4 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/af6593369b649c4cbafba7e13d587c9fb8857ace


-- 
DragonFly BSD source repository


git: mk/crunchgen: Allow to use symlinks for crunched programs

2018-07-01 Thread Aaron LI


commit a4e18c0f6d890e6df865a8832a5dc07dfffe7c02
Author: Aaron LI 
Date:   Sat Jun 9 13:42:51 2018 +0800

mk/crunchgen: Allow to use symlinks for crunched programs

Add support to create symlinks (i.e., soft links) instead of hard links
for the crunched programs.

If the variable CRUNCH_USE_SYMLINKS is set (default: not set), then use
symlinks instead of hard links.

Summary of changes:
 initrd/Makefile.inc|  3 +++
 initrd/bin/Makefile|  3 +++
 initrd/sbin.libcrypto/Makefile |  3 +++
 initrd/sbin/Makefile   |  3 +++
 share/mk/bsd.crunchgen.mk  | 30 ++
 5 files changed, 34 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a4e18c0f6d890e6df865a8832a5dc07dfffe7c02


-- 
DragonFly BSD source repository


git: mk/crunchgen: Do not hard code the path to the source directories

2018-07-01 Thread Aaron LI


commit 8d50421afe51abbc28166f78d133b69d49ffd5ba
Author: Aaron LI 
Date:   Sat Jun 9 13:39:18 2018 +0800

mk/crunchgen: Do not hard code the path to the source directories

Introduce the variable CRUNCH_PATH_${D} to specify the path to the
base source directory ${D}.

Update the description and initrd makefiles accordingly.

Summary of changes:
 initrd/bin/Makefile| 2 ++
 initrd/sbin.libcrypto/Makefile | 3 +++
 initrd/sbin/Makefile   | 2 ++
 share/mk/bsd.crunchgen.mk  | 5 +++--
 4 files changed, 10 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8d50421afe51abbc28166f78d133b69d49ffd5ba


-- 
DragonFly BSD source repository


git: initrd: Crunch lvm(8) with sbin.libcrypto

2018-07-01 Thread Aaron LI


commit 8692d13918892c3f474fc05d37f17fe125bb61bd
Author: Aaron LI 
Date:   Sat Jun 9 23:39:49 2018 +0800

initrd: Crunch lvm(8) with sbin.libcrypto

Do not build lvm(8) alone since it can be crunched together with
sbin.libcrypto which contains cryptsetup(8).  This also saves about
400KB space.

Tidy up the sbin.libcrypto Makefile in the meantime.

Summary of changes:
 initrd/Makefile|  4 +-
 initrd/sbin.libcrypto/Makefile | 48 ---
 initrd/sbin.lvm/Makefile   | 89 --
 3 files changed, 35 insertions(+), 106 deletions(-)
 delete mode 100644 initrd/sbin.lvm/Makefile

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8692d13918892c3f474fc05d37f17fe125bb61bd


-- 
DragonFly BSD source repository


git: initrd: Better check the created initrd before installing

2018-07-01 Thread Aaron LI


commit f170ef5974344c8139485bbe2a8a2cd83c9e5ea5
Author: Aaron LI 
Date:   Sat Jun 9 23:47:31 2018 +0800

initrd: Better check the created initrd before installing

Improve mkinitrd.sh to check /sbin/oinit, /bin/sh and /etc/rc on the
created initrd image to avoid installing a broken one.

Update to use "install" to install the created initrd image to ensure
user/group of root/wheel and mode of 444.

(The command to remove the temporary initrd image was committed in a
previous patch due to squashing.)

Summary of changes:
 initrd/mkinitrd.sh | 11 +++
 1 file changed, 7 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f170ef5974344c8139485bbe2a8a2cd83c9e5ea5


-- 
DragonFly BSD source repository


git: lvm(8): Do not build readline support for the rescue version

2018-07-01 Thread Aaron LI


commit 8f0a90f5d4e9471043d01f7ebda91226c63f6786
Author: Aaron LI 
Date:   Sat Jun 9 23:36:43 2018 +0800

lvm(8): Do not build readline support for the rescue version

Make use of the RESCUE make variable to not build the readline support
for its rescue version (to be installed at /rescue).

Clean up the Makefile.

Summary of changes:
 gnu/sbin/lvm/Makefile | 39 ---
 1 file changed, 20 insertions(+), 19 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8f0a90f5d4e9471043d01f7ebda91226c63f6786


-- 
DragonFly BSD source repository


git: cryptsetup(8): Tidy up Makefile

2018-07-01 Thread Aaron LI


commit 6695d7e4812c9cd0e564ac95224b3cbfe4b5a060
Author: Aaron LI 
Date:   Sat Jun 9 23:35:32 2018 +0800

cryptsetup(8): Tidy up Makefile

Summary of changes:
 gnu/sbin/cryptsetup/Makefile | 30 +-
 1 file changed, 13 insertions(+), 17 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/6695d7e4812c9cd0e564ac95224b3cbfe4b5a060


-- 
DragonFly BSD source repository


git: mk/crunchgen: Remove the unused CRUNCH_BUILDTOOLS support/hack

2018-07-01 Thread Aaron LI


commit eba33b2efa3616876d9268b0da3012077131c8da
Author: Aaron LI 
Date:   Sat Jun 9 13:31:22 2018 +0800

mk/crunchgen: Remove the unused CRUNCH_BUILDTOOLS support/hack

The CRUNCH_BUILDTOOLS is commented out in initrd/bin/Makefile.
And we already use pregenerated headers for bin/sh in commit
cbb07feb2f78629297b21609f526fcec6e4ad8ee .

Summary of changes:
 initrd/bin/Makefile   |  2 --
 share/mk/bsd.crunchgen.mk | 12 
 2 files changed, 14 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/eba33b2efa3616876d9268b0da3012077131c8da


-- 
DragonFly BSD source repository


git: mk/crunchgen: Remove the unimplemented ${_+_}

2018-07-01 Thread Aaron LI


commit b316b9ce72d3ca0de07b830c2d2f3bbd235aa959
Author: Aaron LI 
Date:   Mon Jul 2 09:27:29 2018 +0800

mk/crunchgen: Remove the unimplemented ${_+_}

The ${_+_} make variable is introduced by FreeBSD in revision 133369,
but we don't implement it, so remove it.

Summary of changes:
 share/mk/bsd.crunchgen.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b316b9ce72d3ca0de07b830c2d2f3bbd235aa959


-- 
DragonFly BSD source repository


git: initrd: Add -lpthread for hammer2

2018-07-01 Thread Aaron LI


commit fdfef0004ea9721dabcef8655608993b3dada3e9
Author: Aaron LI 
Date:   Mon Jul 2 10:01:19 2018 +0800

initrd: Add -lpthread for hammer2

The 'pthread' library was lost from commit
8692d13918892c3f474fc05d37f17fe125bb61bd when rebasing.

Summary of changes:
 initrd/sbin.libcrypto/Makefile | 1 +
 1 file changed, 1 insertion(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/fdfef0004ea9721dabcef8655608993b3dada3e9


-- 
DragonFly BSD source repository


git: vi(1): Do not build iconv(3) support for the rescue version

2018-07-01 Thread Aaron LI


commit c4d5b74b53b49427ec4ed19ed3abd071bedff5c6
Author: Aaron LI 
Date:   Mon Jun 11 12:35:33 2018 +0800

vi(1): Do not build iconv(3) support for the rescue version

The iconv(3) support requires dynamic library access, which is impossible 
for
the statically liked rescue version, so disable it.

Taken-from: FreeBSD

Summary of changes:
 usr.bin/vi/Makefile | 8 ++--
 usr.bin/vi/config.h | 4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c4d5b74b53b49427ec4ed19ed3abd071bedff5c6


-- 
DragonFly BSD source repository


git: Makefile.inc1: Remove the obsolete crunch from bootstrap tools

2018-07-01 Thread Aaron LI


commit d3cfb461e4516e842e463c68b46ecf19bcb483a1
Author: Aaron LI 
Date:   Fri Jun 15 12:41:43 2018 +0800

Makefile.inc1: Remove the obsolete crunch from bootstrap tools

Since rescue build is now detached from buildworld, so crunchgen(1)
and crunchide(1) are no longer needed by the buildworld.

Summary of changes:
 Makefile.inc1 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d3cfb461e4516e842e463c68b46ecf19bcb483a1


-- 
DragonFly BSD source repository


git: initrd: Fix parallel build

2018-07-01 Thread Aaron LI


commit 7279052efaf1dc2bca86b53993d0d71ed106b308
Author: Aaron LI 
Date:   Mon Jul 2 09:30:20 2018 +0800

initrd: Fix parallel build

Add explicit target orders to oinit/Makefile, because such orders are
set in  but not in .

Since the make targets (e.g., depend, all, install, clean) are now
ordered, so remove 'clean cleandepend' from the same command as
'depend all install'.

Also allow defining the 'NO_CLEAN" variable to not clean previous builds.

Summary of changes:
 initrd/Makefile   | 9 +
 initrd/oinit/Makefile | 2 ++
 2 files changed, 7 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7279052efaf1dc2bca86b53993d0d71ed106b308


-- 
DragonFly BSD source repository


git: mk/crunchgen: Fix parallel builds by ordering targets

2018-07-01 Thread Aaron LI


commit f5d8234e8535a5fbbccf83bdb9a832e1d5f36088
Author: Aaron LI 
Date:   Mon Jul 2 09:06:31 2018 +0800

mk/crunchgen: Fix parallel builds by ordering targets

Order the build targets (clean, cleandepend, cleandir, obj, objlink,
depend, all, install) to avoid the race in parallel building.  This
change is based on .  Meanwhile, add minor comments to
make the hierarchy clearer in .

Add the 'depend' target for the crunchdir's.

Summary of changes:
 share/mk/bsd.crunchgen.mk | 9 ++---
 share/mk/bsd.subdir.mk| 6 +++---
 2 files changed, 9 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f5d8234e8535a5fbbccf83bdb9a832e1d5f36088


-- 
DragonFly BSD source repository


git: Add the initrd.7 man page

2018-07-02 Thread Aaron LI


commit 2cfd98c8e7ec3b482fae9e58398a28a362806b17
Author: Aaron LI 
Date:   Sun Jul 1 13:23:59 2018 +0800

Add the initrd.7 man page

This man page is partly based on the removed mkinitrd.8 man page
written by Alex Hornung.

Reviewed-by: Sascha Wildner

Summary of changes:
 share/man/man7/Makefile |   2 +-
 share/man/man7/initrd.7 | 170 
 2 files changed, 171 insertions(+), 1 deletion(-)
 create mode 100644 share/man/man7/initrd.7

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2cfd98c8e7ec3b482fae9e58398a28a362806b17


-- 
DragonFly BSD source repository


git: mount(8): Use tab for indentation

2018-06-25 Thread Aaron LI


commit d6e4eb133b6d24740fe4af19068337121f9a56ea
Author: Aaron LI 
Date:   Tue Jun 26 09:53:02 2018 +0800

mount(8): Use tab for indentation

Summary of changes:
 sbin/mount/mount.c | 14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d6e4eb133b6d24740fe4af19068337121f9a56ea


-- 
DragonFly BSD source repository


git: lsvfs(1): Remove an unused define; Avoid a type cast

2018-06-25 Thread Aaron LI


commit be908d4edcae7384d3f9f12d9d400efafdc9ad49
Author: Aaron LI 
Date:   Tue Jun 26 09:56:36 2018 +0800

lsvfs(1): Remove an unused define; Avoid a type cast

Summary of changes:
 usr.bin/lsvfs/lsvfs.c | 8 +++-
 1 file changed, 3 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/be908d4edcae7384d3f9f12d9d400efafdc9ad49


-- 
DragonFly BSD source repository


git: dloader: Remove obsolete "linux_load" from config files

2018-06-25 Thread Aaron LI


commit f05b32115b4a8b23cc5215b93ffb164c2a0c374e
Author: Aaron LI 
Date:   Thu Jan 11 19:47:40 2018 +0800

dloader: Remove obsolete "linux_load" from config files

Based on the patch submitted by mazocomp in bug #3115.

Summary of changes:
 sys/boot/dloader/loader-bootp.conf | 7 ---
 sys/boot/dloader/loader.conf   | 7 ---
 2 files changed, 14 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f05b32115b4a8b23cc5215b93ffb164c2a0c374e


-- 
DragonFly BSD source repository


git: updatedb(8): Be simple and search from "/" by default

2018-06-26 Thread Aaron LI


commit c87dd5363ddd4897d352e9d226c8df16e62f7f04
Author: Aaron LI 
Date:   Tue Jun 26 19:38:17 2018 +0800

updatedb(8): Be simple and search from "/" by default

This reverts the behavior change made in commit
6877ea2d2f7caf9b13202f2524abf3b3cf815b45.

That change causes HAMMER PFSes being ignored from indexing, because the
PFSes, which are null-mounted though, behave like different devices and
thus are ignored by "find -x" (the "-x" option prevents find entering
directories with a different device number).

Workaround or properly deal with the PFSes would be too complex, which I
don't think it's a good idea,  therefore revert to the original behavior.

If one person really wants to ignore the root filesystem but have other
directories indexed, he/she should know to configure the search paths.

Meanwhile, tweak comments and fix whitespaces.

Summary of changes:
 usr.bin/locate/locate/locate.rc   | 24 +++-
 usr.bin/locate/locate/updatedb.sh | 22 +-
 2 files changed, 20 insertions(+), 26 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c87dd5363ddd4897d352e9d226c8df16e62f7f04


-- 
DragonFly BSD source repository


git: DragonFly_RELEASE_5_2 updatedb(8): Be simple and search from "/" by default

2018-06-26 Thread Aaron LI


commit 17021bff834e61e12a47c5bc3b0ea0ff86c8a518
Author: Aaron LI 
Date:   Tue Jun 26 19:38:17 2018 +0800

updatedb(8): Be simple and search from "/" by default

This reverts the behavior change made in commit
6877ea2d2f7caf9b13202f2524abf3b3cf815b45.

That change causes HAMMER PFSes being ignored from indexing, because the
PFSes, which are null-mounted though, behave like different devices and
thus are ignored by "find -x" (the "-x" option prevents find entering
directories with a different device number).

Workaround or properly deal with the PFSes would be too complex, which I
don't think it's a good idea,  therefore revert to the original behavior.

If one person really wants to ignore the root filesystem but have other
directories indexed, he/she should know to configure the search paths.

Meanwhile, tweak comments and fix whitespaces.

Summary of changes:
 usr.bin/locate/locate/locate.rc   | 24 +++-
 usr.bin/locate/locate/updatedb.sh | 22 +-
 2 files changed, 20 insertions(+), 26 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/17021bff834e61e12a47c5bc3b0ea0ff86c8a518


-- 
DragonFly BSD source repository


git: rmuser(8): Use getopts for commandline options

2018-06-26 Thread Aaron LI


commit 15a59a19915f78e28400dfa6e8c5b900e91b84c6
Author: Aaron LI 
Date:   Wed Jun 27 12:59:19 2018 +0800

rmuser(8): Use getopts for commandline options

Improve the option logic a bit and fix whitespaces.

Summary of changes:
 usr.sbin/adduser/rmuser.sh | 96 +++---
 1 file changed, 48 insertions(+), 48 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/15a59a19915f78e28400dfa6e8c5b900e91b84c6


-- 
DragonFly BSD source repository


git: : Fix a minor comment issue

2018-07-03 Thread Aaron LI


commit e596b900d38bef4274497250ca012a5656d05528
Author: Aaron LI 
Date:   Tue Jul 3 19:42:48 2018 +0800

: Fix a minor comment issue

Summary of changes:
 sys/sys/gpt.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e596b900d38bef4274497250ca012a5656d05528


-- 
DragonFly BSD source repository


git: vis(3): Add VIS_ALL support

2018-07-03 Thread Aaron LI


commit 9dbd27e25802bcfced6400231f9f622f9529c7f5
Author: Aaron LI 
Date:   Mon Jun 11 12:44:07 2018 +0800

vis(3): Add VIS_ALL support

OpenSSH requires VIS_ALL and therefore uses the version bundled with
itself, but this causes the vis.o symbol conflicts between libc and
libssh when crunching fstyp(8) with ssh(1).

Bump __DragonFly_version.

Based-on: OpenBSD

Summary of changes:
 include/vis.h|  3 ++-
 lib/libc/gen/unvis.c |  4 
 lib/libc/gen/vis.3   | 10 --
 lib/libc/gen/vis.c   | 14 ++
 sys/sys/param.h  |  3 ++-
 5 files changed, 26 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9dbd27e25802bcfced6400231f9f622f9529c7f5


-- 
DragonFly BSD source repository


git: vis(1): Add option -a to use VIS_ALL

2018-07-03 Thread Aaron LI


commit bbd84283922c2ad51a591bcba1c111c0474b75f8
Author: Aaron LI 
Date:   Mon Jun 11 12:47:36 2018 +0800

vis(1): Add option -a to use VIS_ALL

Taken-from: OpenBSD

Summary of changes:
 usr.bin/vis/vis.1 |  7 +--
 usr.bin/vis/vis.c | 23 +--
 2 files changed, 18 insertions(+), 12 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bbd84283922c2ad51a591bcba1c111c0474b75f8


-- 
DragonFly BSD source repository


git: libssh: No need of compat vis.c as we support VIS_ALL

2018-07-03 Thread Aaron LI


commit a30b61461e41411595cd6cedbc04ba3b02cb5ee0
Author: Aaron LI 
Date:   Mon Jun 11 13:29:31 2018 +0800

libssh: No need of compat vis.c as we support VIS_ALL

This helps avoid the vis.o symbol conflicts between libc and libssh.

Summary of changes:
 lib/libssh/Makefile | 5 ++---
 lib/libssh/config.h | 2 +-
 2 files changed, 3 insertions(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a30b61461e41411595cd6cedbc04ba3b02cb5ee0


-- 
DragonFly BSD source repository


git: Do not auto build rescue tools when ${DESTDIR} != "/"

2018-07-03 Thread Aaron LI


commit 81f07c26a0092e14e306af188076d27601b92328
Author: Aaron LI 
Date:   Tue Jul 3 20:15:17 2018 +0800

Do not auto build rescue tools when ${DESTDIR} != "/"

When installworld to an alternative root (i.e., ${DESTDIR} != "/"),
do not automatically build the rescue tools.

This change won't affect the nrelease build, since it will explicitly
do 'make initrd'.

Suggested-by: swildner

Summary of changes:
 Makefile.inc1 | 22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/81f07c26a0092e14e306af188076d27601b92328


-- 
DragonFly BSD source repository


git: vendor/OPENSSH openssh: Removed unused vis.[ch] from the vendor branch

2018-07-03 Thread Aaron LI


commit 19d5a87fada808e9fb5800450db194b3bb683ca4
Author: Aaron LI 
Date:   Wed Jul 4 13:01:41 2018 +0800

openssh: Removed unused vis.[ch] from the vendor branch

Our libc's vis(3) now supports VIS_ALL, which is required by libssh.

Summary of changes:
 crypto/openssh/openbsd-compat/vis.c | 251 
 crypto/openssh/openbsd-compat/vis.h |  98 --
 2 files changed, 349 deletions(-)
 delete mode 100644 crypto/openssh/openbsd-compat/vis.c
 delete mode 100644 crypto/openssh/openbsd-compat/vis.h

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/19d5a87fada808e9fb5800450db194b3bb683ca4


-- 
DragonFly BSD source repository


git: devfs: Minor style fixes

2018-08-03 Thread Aaron LI


commit 7cf221aeddcc62b2d8ff0b9c77962e33b302318e
Author: Aaron LI 
Date:   Fri Aug 3 20:09:19 2018 +0800

devfs: Minor style fixes

Summary of changes:
 sys/vfs/devfs/devfs_rules.c | 30 +-
 1 file changed, 13 insertions(+), 17 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/7cf221aeddcc62b2d8ff0b9c77962e33b302318e


-- 
DragonFly BSD source repository


git: kernel: Use nitems() from instead of custom define

2018-07-25 Thread Aaron LI


commit 249483dfec1fb7a8da1e2094624856a84033a5b0
Author: Aaron LI 
Date:   Tue Mar 20 15:48:55 2018 +0800

kernel: Use nitems() from  instead of custom define

Since  is already included in these files.

Summary of changes:
 sys/bus/u4b/wlan/if_uath.c   |   4 +-
 sys/bus/u4b/wlan/if_ural.c   |   8 +-
 sys/bus/u4b/wlan/if_urtw.c   |  34 +++
 sys/bus/u4b/wlan/if_zyd.c| 109 ---
 sys/contrib/dev/ath/ath_hal/ar9300/ar9300_gpio.c |   2 -
 sys/contrib/dev/ath/ath_hal/ar9300/ar9300_misc.c |   8 +-
 sys/dev/crypto/safe/safe.c   |   6 +-
 sys/dev/netif/bwn/siba/siba_bwn.c|   3 +-
 sys/dev/netif/bwn/siba/siba_core.c   |  13 ++-
 9 files changed, 63 insertions(+), 124 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/249483dfec1fb7a8da1e2094624856a84033a5b0


-- 
DragonFly BSD source repository


git: Move jail staffs from and to

2018-07-25 Thread Aaron LI


commit e1c6b0c1ee471ec790888a1edec44099e6601971
Author: Aaron LI 
Date:   Tue Mar 20 15:52:54 2018 +0800

Move jail staffs from  and  to 

* : Move out prison_if() function prototype to 

* : Move out prison_replace_wildcards() and prison_remote_ip()
  function prototypes to 

* Include  header for those files in need of it

Obtained-from: FreeBSD (r72786)

Summary of changes:
 sys/net/if.c   |  1 +
 sys/net/if.h   |  5 -
 sys/net/rtsock.c   |  1 +
 sys/netinet/in.h   |  3 ---
 sys/netinet/tcp_usrreq.c   |  1 +
 sys/netinet/udp_usrreq.c   |  1 +
 sys/netinet6/udp6_output.c |  1 +
 sys/netinet6/udp6_usrreq.c |  1 +
 sys/sys/jail.h | 12 +---
 9 files changed, 15 insertions(+), 11 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e1c6b0c1ee471ec790888a1edec44099e6601971


-- 
DragonFly BSD source repository


git: sys/gpt.h: Add new entry types and CTASSERT

2018-07-25 Thread Aaron LI


commit 9db2a7d021973a14dd4fdb2c2992e44c971401ae
Author: Aaron LI 
Date:   Tue Jul 24 09:20:14 2018 +0800

sys/gpt.h: Add new entry types and CTASSERT

Obtained-from: FreeBSD

Summary of changes:
 sys/sys/gpt.h | 40 ++--
 1 file changed, 34 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9db2a7d021973a14dd4fdb2c2992e44c971401ae


-- 
DragonFly BSD source repository


git: disklabel64(8): Remove an obsolete comment

2018-07-25 Thread Aaron LI


commit 87b121bb794a1fa8b3cd0592b348fe6f880475bf
Author: Aaron LI 
Date:   Tue Jul 24 09:22:59 2018 +0800

disklabel64(8): Remove an obsolete comment

Also consistently use the locally defined streq() function.

Summary of changes:
 sbin/disklabel64/disklabel64.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/87b121bb794a1fa8b3cd0592b348fe6f880475bf


-- 
DragonFly BSD source repository


git: if_tun: Add TUNGIFNAME ioctl to get the interface name

2018-07-31 Thread Aaron LI


commit 0df03f127ea71fb9dbcedbdc065f211514feefdf
Author: Aaron LI 
Date:   Tue Jul 31 19:47:37 2018 +0800

if_tun: Add TUNGIFNAME ioctl to get the interface name

This ioctl helps to get the name of the network interface associated
with the tun control device via its file descriptor.  One generally
obtains such a file descriptor by opening the tun autocloner (i.e.,
/dev/tun).  While the devname(3) or fdevname(3) functions can be used
to determine the name of the actually created tun device, but there is
no easy way to get the name of the associated network interface, which
is though initially the same as the device name but can be renamed.

Bump __DragonFly_version and update tun.4 man page.

See also the relevant Linux patch that added TUNGETIFF to tun:

https://lists.linuxfoundation.org/pipermail/virtualization/2008-August/011546.html

Summary of changes:
 share/man/man4/tun.4 | 10 +-
 sys/net/tun/if_tun.c |  6 ++
 sys/net/tun/if_tun.h |  5 -
 sys/sys/param.h  |  3 ++-
 4 files changed, 21 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0df03f127ea71fb9dbcedbdc065f211514feefdf


-- 
DragonFly BSD source repository


git: if_tap: Remove the unnecessary forward declaration in if_tap.h

2018-07-31 Thread Aaron LI


commit 5b60e9a77859ef101953a2cd02eebd630d8387d0
Author: Aaron LI 
Date:   Tue Jul 31 19:59:45 2018 +0800

if_tap: Remove the unnecessary forward declaration in if_tap.h

Summary of changes:
 sys/net/tap/if_tap.h | 2 --
 1 file changed, 2 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5b60e9a77859ef101953a2cd02eebd630d8387d0


-- 
DragonFly BSD source repository


git: if_tun: Clean up tunioctl()

2018-07-31 Thread Aaron LI


commit a50e0e62c76c85f67283f9bce5cf9021d64ae2c7
Author: Aaron LI 
Date:   Tue Jul 31 19:43:48 2018 +0800

if_tun: Clean up tunioctl()

Introduce a variable 'caddr_t data' to make code cleaner.  Also improve
the switch flow a bit.

Based on: if_tap.c

Summary of changes:
 sys/net/tun/if_tun.c | 45 +
 1 file changed, 25 insertions(+), 20 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a50e0e62c76c85f67283f9bce5cf9021d64ae2c7


-- 
DragonFly BSD source repository


git: ifconfig(8): Use nitems() consistently

2018-08-04 Thread Aaron LI


commit b6b91ec7b04797351b4efc099cd2b5530c90a328
Author: Aaron LI 
Date:   Tue Mar 20 15:45:43 2018 +0800

ifconfig(8): Use nitems() consistently

Summary of changes:
 sbin/ifconfig/af_inet6.c|  4 +---
 sbin/ifconfig/ifbridge.c|  6 ++
 sbin/ifconfig/ifcarp.c  |  4 +---
 sbin/ifconfig/ifclone.c |  4 +---
 sbin/ifconfig/ifconfig.c|  6 +-
 sbin/ifconfig/ifieee80211.c | 12 +++-
 sbin/ifconfig/iflagg.c  | 10 --
 sbin/ifconfig/ifmedia.c |  4 +---
 sbin/ifconfig/ifvlan.c  |  4 +---
 sbin/ifconfig/regdomain.c   |  2 +-
 10 files changed, 16 insertions(+), 40 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/b6b91ec7b04797351b4efc099cd2b5530c90a328


-- 
DragonFly BSD source repository


git: ifconfig(8): Sync with FreeBSD a bit and various cleanups

2018-08-04 Thread Aaron LI


commit 46158ff547aeb44d75edbca7a8c8ecd565aec166
Author: Aaron LI 
Date:   Sat Mar 24 16:56:39 2018 +0800

ifconfig(8): Sync with FreeBSD a bit and various cleanups

* Sync ifconfig.c a bit with FreeBSD; replace several warnx() with
  errx(), and improve error messages a bit.

* Remove unnecessary exit() after Perror().

* Sync if_clone.c with FreeBSD.

* Add inclusion guard to ifconfig.h.

* Make iseq() a static function for ifieee80211.c and regdomain.c,
  replacing the duplicate definitions of it; and use iseq()
  consistently to replace strncasecmp() and strcasecmp().

* Move "struct ident" from regdomain.c to regdomain.h, and add and use
  "enum IdentType".

* Various whitespace cleanups.

* Cleanup header file inclusion: remove duplicates, and reorder a bit.

* Fix various signed vs. unsigned comparisons.

* Fix some compilation warnings, and raise WARNS to 3.

Summary of changes:
 sbin/ifconfig/Makefile  |   6 +-
 sbin/ifconfig/af_inet.c |  21 ++---
 sbin/ifconfig/af_inet6.c|  45 +
 sbin/ifconfig/af_link.c |   8 +-
 sbin/ifconfig/ifbridge.c|  20 ++--
 sbin/ifconfig/ifcarp.c  |  13 +--
 sbin/ifconfig/ifclone.c |  22 +++--
 sbin/ifconfig/ifconfig.c| 127 -
 sbin/ifconfig/ifconfig.h|   9 +-
 sbin/ifconfig/ifieee80211.c | 224 
 sbin/ifconfig/iflagg.c  |  23 ++---
 sbin/ifconfig/ifmedia.c |  11 +--
 sbin/ifconfig/ifvlan.c  |  11 +--
 sbin/ifconfig/regdomain.c   |  29 +++---
 sbin/ifconfig/regdomain.h   |  16 +++-
 15 files changed, 299 insertions(+), 286 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/46158ff547aeb44d75edbca7a8c8ecd565aec166


-- 
DragonFly BSD source repository


git: ifconfig(8): Use strlcpy() instead of strncpy()

2018-08-04 Thread Aaron LI


commit 80d2947bc9bb9395f7b2e028b5582c23a2858812
Author: Aaron LI 
Date:   Fri Mar 23 09:37:13 2018 +0800

ifconfig(8): Use strlcpy() instead of strncpy()

Summary of changes:
 sbin/ifconfig/af_inet.c |  4 ++--
 sbin/ifconfig/ifcarp.c  |  4 ++--
 sbin/ifconfig/ifclone.c |  4 ++--
 sbin/ifconfig/ifconfig.c| 20 ++--
 sbin/ifconfig/ifieee80211.c | 20 ++--
 sbin/ifconfig/ifmedia.c | 11 +--
 sbin/ifconfig/ifvlan.c  |  2 +-
 7 files changed, 32 insertions(+), 33 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/80d2947bc9bb9395f7b2e028b5582c23a2858812


-- 
DragonFly BSD source repository


git: ifconfig(8): Use atexit() to ensure printing interface name

2018-08-04 Thread Aaron LI


commit e9e1626f77881d1971173b83792c178b084ff759
Author: Aaron LI 
Date:   Fri Jun 22 21:23:25 2018 +0800

ifconfig(8): Use atexit() to ensure printing interface name

The ifconfig program may not exit at the end of its main() function,
so use atexit(printifnamemaybe) to ensure the interface name (e.g.,
newly cloned but with wildcard name) is printed on exit.
(Taken from FreeBSD)

Use "return (0)" instead of "exit(0)" in the main() function.

Minor whitespace updates.

Summary of changes:
 sbin/ifconfig/ifconfig.c | 28 
 1 file changed, 20 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e9e1626f77881d1971173b83792c178b084ff759


-- 
DragonFly BSD source repository


git: : Clean up unused forward declaration

2018-08-04 Thread Aaron LI


commit 03d44125d13c9b84745fca401c1fd8cefd5db97b
Author: Aaron LI 
Date:   Tue Mar 20 16:15:42 2018 +0800

: Clean up unused forward declaration

Also remove the inclusion of an unnecessary header .

Summary of changes:
 sys/net/if_var.h | 10 +-
 1 file changed, 1 insertion(+), 9 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/03d44125d13c9b84745fca401c1fd8cefd5db97b


-- 
DragonFly BSD source repository


git: if_tap: Interface type should be IFT_ETHER

2018-08-04 Thread Aaron LI


commit ce57146ea9d232b3f8a60279de0bdf859bde4c3f
Author: Aaron LI 
Date:   Sat Aug 4 21:07:04 2018 +0800

if_tap: Interface type should be IFT_ETHER

Summary of changes:
 sys/net/tap/if_tap.c | 1 +
 1 file changed, 1 insertion(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ce57146ea9d232b3f8a60279de0bdf859bde4c3f


-- 
DragonFly BSD source repository


git: if_tap: Interface type should be IFT_ETHER (2)

2018-08-04 Thread Aaron LI


commit e389314b1feb6a5659f5f52a71878f14c29091af
Author: Aaron LI 
Date:   Sat Aug 4 22:06:32 2018 +0800

if_tap: Interface type should be IFT_ETHER (2)

Ooops, forgot to include the necessary header  in the
last commit.

Summary of changes:
 sys/net/tap/if_tap.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e389314b1feb6a5659f5f52a71878f14c29091af


-- 
DragonFly BSD source repository


git: etc/login.conf: Fix COPYRIGHT file path

2018-08-04 Thread Aaron LI


commit e72f0762b947abfb33852312cbec661ce8761559
Author: Aaron LI 
Date:   Sun Aug 5 10:40:46 2018 +0800

etc/login.conf: Fix COPYRIGHT file path

Summary of changes:
 etc/login.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e72f0762b947abfb33852312cbec661ce8761559


-- 
DragonFly BSD source repository


git: Makefile.inc1: Print more variables on error

2018-08-04 Thread Aaron LI


commit 81c8572743904f1c4c2a1f44b4edbc274122ea11
Author: Aaron LI 
Date:   Fri Jun 15 13:01:54 2018 +0800

Makefile.inc1: Print more variables on error

Print the .MAKE.MODE, PATH, MAKESYSPATH, MAKEOBJDIRPREFIX, DESTDIR,
SHELL, .SHELL, .MAKE.MAKEFILES, and .PATH variables on error.
(Based on FreeBSD: share/mk/{local,meta}.sys.mk)

Summary of changes:
 Makefile.inc1 | 15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/81c8572743904f1c4c2a1f44b4edbc274122ea11


-- 
DragonFly BSD source repository


git: : Do not include for _KERNEL

2018-08-04 Thread Aaron LI


commit bff82488b6f45c2f067e4c552e649b1d3e07cd7c
Author: Aaron LI 
Date:   Tue Mar 20 16:04:41 2018 +0800

: Do not include  for _KERNEL

* Clean up an ancient leftover: do not include  from 

  for kernel stuffs.

* Adjust various files to include the necessary  header.

NOTE:
I have also tested removing the inclusion of  from ,
therefore add  inclusion for those files that need it but only
included .  For some files, the header inclusion orderings are
also adjusted.

Summary of changes:
 sys/bus/u4b/net/if_udav.c |  2 ++
 sys/bus/u4b/usb_pf.c  |  1 +
 sys/dev/netif/ig_hal/e1000_osdep.c|  2 +-
 sys/dev/netif/mii_layer/acphy.c   |  1 +
 sys/dev/netif/mii_layer/amphy.c   |  1 +
 sys/dev/netif/mii_layer/e1000phy.c|  1 +
 sys/dev/netif/mii_layer/exphy.c   |  1 +
 sys/dev/netif/mii_layer/inphy.c   |  1 +
 sys/dev/netif/mii_layer/jmphy.c   |  1 +
 sys/dev/netif/mii_layer/lxtphy.c  |  1 +
 sys/dev/netif/mii_layer/mii_physubr.c |  1 +
 sys/dev/netif/mii_layer/mlphy.c   |  1 +
 sys/dev/netif/mii_layer/nsgphy.c  |  1 +
 sys/dev/netif/mii_layer/nsphy.c   |  1 +
 sys/dev/netif/mii_layer/pnaphy.c  |  1 +
 sys/dev/netif/mii_layer/qsphy.c   |  1 +
 sys/dev/netif/mii_layer/ruephy.c  |  1 +
 sys/dev/netif/mii_layer/tlphy.c   |  1 +
 sys/dev/netif/mii_layer/ukphy.c   |  1 +
 sys/dev/netif/mii_layer/xmphy.c   |  1 +
 sys/dev/netif/ral/if_ral_pci.c|  1 +
 sys/dev/netif/sln/if_sln.c|  4 ++--
 sys/emulation/ndis/subr_u4bd.c|  1 +
 sys/kern/kern_uuid.c  |  1 +
 sys/kern/sys_socket.c |  1 +
 sys/net/altq/altq_red.c   |  1 +
 sys/net/altq/altq_rio.c   |  1 +
 sys/net/altq/altq_rmclass.c   |  1 +
 sys/net/dummynet/ip_dummynet.c|  1 +
 sys/net/dummynet3/ip_dummynet3.c  |  1 +
 sys/net/if.h  |  8 +---
 sys/net/if_clone.c|  1 +
 sys/net/if_media.c|  1 +
 sys/net/if_mib.c  |  1 +
 sys/net/if_poll.c |  1 +
 sys/net/ipfw3/ip_fw3.c| 12 ++--
 sys/net/ipfw3_basic/ip_fw3_sync.c | 12 ++--
 sys/net/ipfw3_basic/ip_fw3_table.c| 12 ++--
 sys/net/ipfw3_layer2/ip_fw3_layer2.c  |  1 +
 sys/net/ipfw3_layer4/ip_fw3_layer4.c  | 13 +++--
 sys/net/net_osdep.c   |  1 +
 sys/net/pf/pf_norm.c  |  1 +
 sys/net/pfil.c|  1 +
 sys/net/route.c   |  1 +
 sys/net/rtsock.c  |  1 +
 sys/netbt/hci.h   |  3 ++-
 sys/netgraph/bridge/ng_bridge.c   |  1 +
 sys/netgraph/pppoe/ng_pppoe.c |  1 +
 sys/netinet/tcp_output.c  |  1 +
 sys/netproto/802_11/wlan/ieee80211_crypto.c   |  1 +
 sys/netproto/802_11/wlan/ieee80211_crypto_none.c  |  1 +
 sys/netproto/802_11/wlan/ieee80211_hwmp.c |  1 +
 sys/netproto/802_11/wlan/ieee80211_phy.c  |  1 +
 sys/netproto/802_11/wlan/ieee80211_ratectl.c  |  1 +
 sys/netproto/802_11/wlan/ieee80211_ratectl_none.c |  1 +
 sys/netproto/802_11/wlan/ieee80211_tdma.c |  1 +
 sys/netproto/802_11/wlan_acl/ieee80211_acl.c  |  1 +
 sys/netproto/802_11/wlan_ccmp/ieee80211_crypto_ccmp.c |  1 +
 sys/netproto/802_11/wlan_tkip/ieee80211_crypto_tkip.c |  1 +
 sys/netproto/802_11/wlan_wep/ieee80211_crypto_wep.c   |  1 +
 sys/netproto/802_11/wlan_xauth/ieee80211_xauth.c  |  1 +
 sys/vfs/nfs/nfs_vfsops.c  |  1 +
 62 files changed, 86 insertions(+), 35 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bff82488b6f45c2f067e4c552e649b1d3e07cd7c


-- 
DragonFly BSD source repository


git: if_clone: Fix if_clone_destroy() with renamed cloned interface

2018-08-04 Thread Aaron LI


commit 3b1300daa841e3b20ed7417394ab6039c5f2506b
Author: Aaron LI 
Date:   Sat Aug 4 20:30:04 2018 +0800

if_clone: Fix if_clone_destroy() with renamed cloned interface

Since the interface can be renamed (SIOCSIFNAME), it's very wrong for
if_clone_destroy() to determine the unit number from interface name,
which has the following two serious problems:

(1) One may only change the unit number in the interface name, then
trying to destroy the interface will panic the system. e.g.,
% ifconfig tap0 create
% ifconfig tap0 name tap
% ifconfig tap destroy
-> panic: if_clone_destroy: bit is already cleared

(2) The renamed interface cannot be destroyed anymore. e.g.,
% ifconfig tap0 create
% ifconfig tap0 name test
% ifconfig test destroy
-> ifconfig: SIOCIFDESTROY: Invalid argument

Fix the code to use the 'if_dunit' as the correct interface unit number.

Thanks to Jason A. Donenfeld  and Brady OBrien
 for pointing out the above problem (1).

Summary of changes:
 sys/net/if_clone.c | 36 +++-
 1 file changed, 15 insertions(+), 21 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3b1300daa841e3b20ed7417394ab6039c5f2506b


-- 
DragonFly BSD source repository


git: if_clone: Remove unneeded "ifc_namelen" from "struct if_clone"

2018-08-04 Thread Aaron LI


commit e224e5e71c0cee920b6a50d3397ff5e45be95e9a
Author: Aaron LI 
Date:   Sat Aug 4 20:13:39 2018 +0800

if_clone: Remove unneeded "ifc_namelen" from "struct if_clone"

The "strlen(ifc_name)" is used instead.

Summary of changes:
 sys/net/if_clone.c | 2 +-
 sys/net/if_clone.h | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e224e5e71c0cee920b6a50d3397ff5e45be95e9a


-- 
DragonFly BSD source repository


git: if_clone: Move "struct if_clonereq" over from

2018-08-04 Thread Aaron LI


commit 687c518e9dcb04166a0c34c27d609eaf82d1a5e2
Author: Aaron LI 
Date:   Thu Jun 21 08:36:00 2018 +0800

if_clone: Move "struct if_clonereq" over from 

The "if_clonereq" struct is __BSD_VISIBLE and is only used by ifconfig(8)
userland tool (via searching "if_clonereq" in the dports grok), so it's
safe to move it to  to be clearer.

Summary of changes:
 sbin/ifconfig/ifclone.c |  1 +
 sys/net/if.h| 14 ++
 sys/net/if_clone.h  | 13 +++--
 3 files changed, 14 insertions(+), 14 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/687c518e9dcb04166a0c34c27d609eaf82d1a5e2


-- 
DragonFly BSD source repository


git: if_clone: Fix if_clone_event invocation

2018-08-04 Thread Aaron LI


commit 0de0168f3274e2e1ddf79404ed32abbef82a8893
Author: Aaron LI 
Date:   Thu Jun 21 08:42:16 2018 +0800

if_clone: Fix if_clone_event invocation

As the parameter passed to the "if_clone_event" handler indicates, this
event should be triggered when a new interface cloner is *attached*,
rather than when a clone interface is created.  (Based on FreeBSD)

Update the eventhandler.9 man page accordingly.

Summary of changes:
 share/man/man9/EVENTHANDLER.9 | 6 +++---
 sys/net/if_clone.c| 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0de0168f3274e2e1ddf79404ed32abbef82a8893


-- 
DragonFly BSD source repository


git: if_clone: Refactor if_clone_create()

2018-08-04 Thread Aaron LI


commit 84cb91c376f39e5cbfcc52664bc818ac8154e0c6
Author: Aaron LI 
Date:   Fri Jun 22 21:47:22 2018 +0800

if_clone: Refactor if_clone_create()

In the wildcard case (the caller passes the interface name without
a unit number), if_clone_create() should update the passed name
parameter with the allocated unit number in order to make the caller
know the name of the cloned interface, e.g., ifconfig(8) compares
the passed and returned interface name.  Therefore the caller should
preserve enough space (given by the "len" parameter) to hold the full
interface name.  This shouldn't be a problem since the caller generally
use the "struct if_clonereq" which has enough space for the name.

For the name update code, use simple and clear strlcpy() to replace the
hack with a for loop and obscure snprintf(), and return ENOSPC instead
of panic.

Simplify the ifnet lock a bit.

Summary of changes:
 sys/net/if_clone.c | 40 
 1 file changed, 20 insertions(+), 20 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/84cb91c376f39e5cbfcc52664bc818ac8154e0c6


-- 
DragonFly BSD source repository


git: if_clone: Refactor cloner lookup and unit extraction

2018-08-04 Thread Aaron LI


commit 2010725f220e9d634a6a5904b38db67627cb3a80
Author: Aaron LI 
Date:   Sat Aug 4 20:06:21 2018 +0800

if_clone: Refactor cloner lookup and unit extraction

Break down the old 'if_clone_lookup()' function into the following 3
functions:

- if_name2unit(): extract the unit number from the interface name.
  Obtained from FreeBSD and has fixes (disallow leading zeros; avoid
  unit overflow).

- if_clone_match(): check whether the cloner matches the interface name.

- new if_clone_lookup(): only lookup the cloner for the interface name.

Summary of changes:
 sys/net/if_clone.c | 105 +
 1 file changed, 73 insertions(+), 32 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2010725f220e9d634a6a5904b38db67627cb3a80


-- 
DragonFly BSD source repository


git: DragonFly_RELEASE_5_2 if_clone: Fix if_clone_destroy() with renamed cloned interface

2018-08-05 Thread Aaron LI


commit e2d4945959773df738afe9def357f1efda11428e
Author: Aaron LI 
Date:   Sat Aug 4 20:30:04 2018 +0800

if_clone: Fix if_clone_destroy() with renamed cloned interface

Since the interface can be renamed (SIOCSIFNAME), it's very wrong for
if_clone_destroy() to determine the unit number from interface name,
which has the following two serious problems:

(1) One may only change the unit number in the interface name, then
trying to destroy the interface will panic the system. e.g.,
% ifconfig tap0 create
% ifconfig tap0 name tap
% ifconfig tap destroy
-> panic: if_clone_destroy: bit is already cleared

(2) The renamed interface cannot be destroyed anymore. e.g.,
% ifconfig tap0 create
% ifconfig tap0 name test
% ifconfig test destroy
-> ifconfig: SIOCIFDESTROY: Invalid argument

Fix the code to use the 'if_dunit' as the correct interface unit number.

Thanks to Jason A. Donenfeld  and Brady O'Brien
 for pointing out the above problem (1).

Summary of changes:
 sys/net/if_clone.c | 28 
 1 file changed, 12 insertions(+), 16 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e2d4945959773df738afe9def357f1efda11428e


-- 
DragonFly BSD source repository


git: Revert "pf: Allow disappearing or not yet existing interfaces for ALTQ"

2018-08-08 Thread Aaron LI


commit d15093b968014ef49e9a6d18ef3d97557410473e
Author: Aaron LI 
Date:   Thu Aug 9 10:40:36 2018 +0800

Revert "pf: Allow disappearing or not yet existing interfaces for ALTQ"

This reverts commit 0a887f91f9633448c99b9a5b7c6116a0a22d25d6.

1. It's incorrect to change the ifnet_unlock().  The original protection
   range is used to make sure that the ifp does not get ripped out behind
   our back.

2. We don't suffer from the issue that that commit was intended to fix.

Thanks-to: sephe

Summary of changes:
 sys/net/pf/pf_if.c|  10 
 sys/net/pf/pf_ioctl.c | 123 +++---
 sys/net/pf/pfvar.h|   6 ---
 usr.sbin/pfctl/pfctl_altq.c   |   4 --
 usr.sbin/pfctl/pfctl_qstats.c |  17 +-
 5 files changed, 21 insertions(+), 139 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d15093b968014ef49e9a6d18ef3d97557410473e


-- 
DragonFly BSD source repository


Re: git: pf: Allow disappearing or not yet existing interfaces for ALTQ

2018-08-08 Thread Aaron LI
Thanks for the explanation.

As you said we don't have the issue that this commit is intended to fix, I'd
revert the whole commit, OK?



On Thu, 9 Aug 2018 09:05:18 +0800
Sepherosa Ziehau  wrote:

> Please backout the "simplify the ifnet_unlock" part.  The original
> protection range is used to make sure that the ifp does not get ripped
> out behind our back.  To be frank, we don't even suffer the issue this
> fix is intended to address; it only makes the code convoluted.
> 
> On Wed, Aug 8, 2018 at 5:10 PM, Aaron LI 
> wrote:
> >
> > commit 0a887f91f9633448c99b9a5b7c6116a0a22d25d6
> > Author: Aaron LI 
> > Date:   Sat Jun 16 23:18:20 2018 +0800
> >
> > pf: Allow disappearing or not yet existing interfaces for ALTQ
> >
> > Make ALTQ cope with disappearing interfaces (particularly common with
> > net/mpd4 and netgraph in general).  This also allows to add queues for
> > an interface that is not yet existing, however, you have to provide
> > the bandwidth for the interface.
> >
> > Meanwhile, simplify the ifnet_unlock() calls for ifunit() use.
> >
> > Taken-from: FreeBSD (r177700)
> >
> > Summary of changes:
> >  sys/net/pf/pf_if.c|  10 
> >  sys/net/pf/pf_ioctl.c | 123
> > +++--- sys/net/pf/pfvar.h
> > |   6 +++ usr.sbin/pfctl/pfctl_altq.c   |   4 ++
> >  usr.sbin/pfctl/pfctl_qstats.c |  17 +-
> >  5 files changed, 139 insertions(+), 21 deletions(-)
> >
> > http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0a887f91f9633448c99b9a5b7c6116a0a22d25d6
> >
> >
> > --
> > DragonFly BSD source repository  



pgpTGQ8Bbykwp.pgp
Description: OpenPGP digital signature


git: development.7: Update repo creation command

2018-08-06 Thread Aaron LI


commit 64fc8f067a489eef06793f317eb541d87131fc29
Author: Aaron LI 
Date:   Tue Aug 7 10:40:31 2018 +0800

development.7: Update repo creation command

Reported-by: resolution (on IRC)

Summary of changes:
 share/man/man7/development.7 | 9 -
 1 file changed, 4 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/64fc8f067a489eef06793f317eb541d87131fc29


-- 
DragonFly BSD source repository


git: eventhandler: Implement ifnet_event

2018-08-08 Thread Aaron LI


commit fcddd1b6c3b2924a8a022caf183b8f186e7d5cae
Author: Aaron LI 
Date:   Mon Jun 25 17:00:21 2018 +0800

eventhandler: Implement ifnet_event

Implement the "ifnet_event" which is triggered on interface up and down.

Taken-from: FreeBSD

Summary of changes:
 share/man/man9/EVENTHANDLER.9 | 4 +++-
 sys/net/if.c  | 2 ++
 sys/net/if_var.h  | 5 +
 3 files changed, 10 insertions(+), 1 deletion(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/fcddd1b6c3b2924a8a022caf183b8f186e7d5cae


-- 
DragonFly BSD source repository


git: bpf: Move bpf_track event declaration to

2018-08-08 Thread Aaron LI


commit e826117ee8aacb5698d8c6af3d39ba34be643c84
Author: Aaron LI 
Date:   Mon Jun 25 17:31:16 2018 +0800

bpf: Move bpf_track event declaration to 

Move the declaration of the "bpf_track" event from 
to .

Document the "bpf_track" event in eventhandler.9 man page.

Based on FreeBSD.

Summary of changes:
 share/man/man9/EVENTHANDLER.9 |  3 +++
 sys/net/bpf.h | 20 
 sys/sys/eventhandler.h|  6 --
 3 files changed, 15 insertions(+), 14 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e826117ee8aacb5698d8c6af3d39ba34be643c84


-- 
DragonFly BSD source repository


git: eventhandler.9: Update events list

2018-08-08 Thread Aaron LI


commit acc24b690ed6d89cb2611bb8ee46800d01acaa84
Author: Aaron LI 
Date:   Mon Jun 25 17:59:15 2018 +0800

eventhandler.9: Update events list

* Remove "dev_clone"

* Add "iflladdr_event", "mountroot", and "usb_dev_configured".
  Descriptions are taken from FreeBSD.

Summary of changes:
 share/man/man9/EVENTHANDLER.9 | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/acc24b690ed6d89cb2611bb8ee46800d01acaa84


-- 
DragonFly BSD source repository


git: eventhandler: Implement ifnet_link_event

2018-08-08 Thread Aaron LI


commit bc1a39e222197cb9e98ed508f3994662d5d3fc75
Author: Aaron LI 
Date:   Mon Jun 25 17:04:41 2018 +0800

eventhandler: Implement ifnet_link_event

The "ifnet_link_event" is triggered by the change of the link state of
an interface.

Taken-from: FreeBSD

Summary of changes:
 share/man/man9/EVENTHANDLER.9 | 2 ++
 sys/net/if.c  | 2 ++
 sys/net/if_var.h  | 3 +++
 3 files changed, 7 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/bc1a39e222197cb9e98ed508f3994662d5d3fc75


-- 
DragonFly BSD source repository


git: Move pf.conf.5 and pf.os.5 to share/man/man5

2018-08-08 Thread Aaron LI


commit d27abe81872597163e3d797770ce9aaf71bbb6c7
Author: Aaron LI 
Date:   Tue Jun 26 12:25:07 2018 +0800

Move pf.conf.5 and pf.os.5 to share/man/man5

Summary of changes:
 share/man/man5/Makefile  | 3 ++-
 {usr.sbin/pfctl => share/man/man5}/pf.conf.5 | 0
 {usr.sbin/pfctl => share/man/man5}/pf.os.5   | 0
 usr.sbin/pfctl/Makefile  | 2 +-
 4 files changed, 3 insertions(+), 2 deletions(-)
 rename {usr.sbin/pfctl => share/man/man5}/pf.conf.5 (100%)
 rename {usr.sbin/pfctl => share/man/man5}/pf.os.5 (100%)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d27abe81872597163e3d797770ce9aaf71bbb6c7


-- 
DragonFly BSD source repository


git: pf: Allow disappearing or not yet existing interfaces for ALTQ

2018-08-08 Thread Aaron LI


commit 0a887f91f9633448c99b9a5b7c6116a0a22d25d6
Author: Aaron LI 
Date:   Sat Jun 16 23:18:20 2018 +0800

pf: Allow disappearing or not yet existing interfaces for ALTQ

Make ALTQ cope with disappearing interfaces (particularly common with
net/mpd4 and netgraph in general).  This also allows to add queues for
an interface that is not yet existing, however, you have to provide
the bandwidth for the interface.

Meanwhile, simplify the ifnet_unlock() calls for ifunit() use.

Taken-from: FreeBSD (r177700)

Summary of changes:
 sys/net/pf/pf_if.c|  10 
 sys/net/pf/pf_ioctl.c | 123 +++---
 sys/net/pf/pfvar.h|   6 +++
 usr.sbin/pfctl/pfctl_altq.c   |   4 ++
 usr.sbin/pfctl/pfctl_qstats.c |  17 +-
 5 files changed, 139 insertions(+), 21 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/0a887f91f9633448c99b9a5b7c6116a0a22d25d6


-- 
DragonFly BSD source repository


git: pf: Fix and improve interface group support

2018-08-08 Thread Aaron LI


commit c686757e01dd668abe9817cf3e78f18b4de62be7
Author: Aaron LI 
Date:   Sat Jun 16 22:48:38 2018 +0800

pf: Fix and improve interface group support

The old PF code has broken partial support of the interface group.
Without this patch, loading the 'pf.ko' module will panic the system.

* Add event handlers of pfi_{attach,detach,change}_group_event()
  to support the interface groups.  Meanwhile, add event handler
  of pfi_ifaddr_event() that is called when an address is set up
  on an interface, and update pfi_{attach,detach}_event() handlers.
  (Based on FreeBSD)

* Remove function pfi_kifaddr_update() as it is merged into
  pfi_ifaddr_event() handler.

* Update pfi_initialize() and pfi_cleanup() functions (Based on
  FreeBSD).

* Split function pfi_kif_find() out of pfi_kif_get().
  (Based on OpenBSD)

* The PF module will be properly initialized on module load, so remove
  extra pfi_initialize() calls.

* Rename malloc type 'PFI_MTYPE' to 'M_PFI',  and merge with malloc type
  'M_PFIADDRPL'.

* Staticize internal functions and variables.

* Some cleanups and style updates.

Thanks to sephe for the guidance.

Summary of changes:
 sys/net/pf/pf_if.c| 390 ++
 sys/net/pf/pf_ioctl.c |   9 +-
 sys/net/pf/pfvar.h|   2 +-
 3 files changed, 212 insertions(+), 189 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c686757e01dd668abe9817cf3e78f18b4de62be7


-- 
DragonFly BSD source repository


git: pf: Update pfi_kif and pfi_kif_cmp structs

2018-08-08 Thread Aaron LI


commit 3bbcdcc2594c6b74fb7c860ceebf1713b0ad56ef
Author: Aaron LI 
Date:   Thu Jun 21 08:59:47 2018 +0800

pf: Update pfi_kif and pfi_kif_cmp structs

For struct "pfi_kif", add "pfik_name" entry while remove multiple obsolete
entries and macros.  Rename "pfik_ifname" to "pfik_name" for "pfi_kif_cmp"
struct.

Based on both OpenBSD and FreeBSD.

Summary of changes:
 sys/net/pf/pfvar.h | 16 ++--
 1 file changed, 2 insertions(+), 14 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/3bbcdcc2594c6b74fb7c860ceebf1713b0ad56ef


-- 
DragonFly BSD source repository


git: net: Implement interface group support

2018-08-08 Thread Aaron LI


commit 233c85704a96468c162480f32a6e092b81b0cdaf
Author: Aaron LI 
Date:   Sat Jun 16 22:25:31 2018 +0800

net: Implement interface group support

The network interface group (aka ifgroup) functionality is currently only
used by the PF (still needs patch to make PF use the ifgroup), allowing
rules to use group names instead of the specific interface names, which
makes firewall rules more generic and simpler.

* The ifgroup data are stored at the following two places:
  - The global list of 'struct ifg_group': each entry is a group which has
the name and members (a list of pointers to the interfaces).
  - The per-ifnet 'if_groups' list, which records the groups that the
interface belongs to.

* Introduce the 'ifgroup_lock' locakmgr(9) to protect the global list
  of 'struct ifg_group' and per-ifnet 'if_groups' list.  The R/W locking
  operations are provided by the ifgroup_lockmgr() function.

* Move the copyout() out of the locked loop in if_getgroups() and
  if_getgroupmembers() functions.

* Fix several M_NOWAIT to be M_WAITOK.

* Use M_IFNET instead of M_TEMP for allocated ifgroup memory.

* Add SIOC[ADG]IFGROUP and SIOCGIFGMEMB ioctl's,
  bump __DragonFly_version.

* Add invocations to group_{attach,change,detach}_event handlers.

* Update eventhandler.9 man page.

* Some style updates.

Great thanks to sephe for his patient guidance and review.

Credit to both FreeBSD and OpenBSD for the ifgroup functionality.

NOTE:
When delete the only group from an interface, which leaves an empty
group that will be destroyed, make sure the group_change_event event
is invoked *before* the group destroy (i.e., group_detach_event).
Both FreeBSD and OpenBSD have the ordering problem with group detach
event.  Need to report the problem to them.

Summary of changes:
 share/man/man9/EVENTHANDLER.9 |   8 +-
 sys/net/if.c  | 347 --
 sys/net/if.h  |   4 +-
 sys/net/if_var.h  |  38 +++--
 sys/sys/param.h   |   3 +-
 sys/sys/sockio.h  |   5 +-
 6 files changed, 272 insertions(+), 133 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/233c85704a96468c162480f32a6e092b81b0cdaf


-- 
DragonFly BSD source repository


git: ifconfig(8): Add group support

2018-08-08 Thread Aaron LI


commit d4024308578796b864d264d08e7cd14719d0c00a
Author: Aaron LI 
Date:   Sat Jun 16 23:01:21 2018 +0800

ifconfig(8): Add group support

Obtained from FreeBSD, with some minor changes.

Summary of changes:
 sbin/ifconfig/Makefile   |   1 +
 sbin/ifconfig/ifconfig.8 |  22 +-
 sbin/ifconfig/ifgroup.c  | 183 +++
 3 files changed, 205 insertions(+), 1 deletion(-)
 create mode 100644 sbin/ifconfig/ifgroup.c

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/d4024308578796b864d264d08e7cd14719d0c00a


-- 
DragonFly BSD source repository


git: if_pflog: Explicitly depend on "pf" and various cleanups

2018-08-08 Thread Aaron LI


commit a6ccd68b08eff10c57551f8fe92f39a5b8ae6c48
Author: Aaron LI 
Date:   Thu Jun 21 09:31:44 2018 +0800

if_pflog: Explicitly depend on "pf" and various cleanups

* Explicitly depend on the "pf" module to make sure it is initialized
  later than the "pf" main module.

* Fix a missing lwkt token release in pflog_clone_create().

* Remove unnecessary kmalloc() check.

* Use if_initname() to properly set up if_{xname,dname,dunit}.

* Use pflogattach() in module load event handle.

* Staticize functions and variables.

* Remove the unused pflogrtrequest() function.

* Remove the "old_pfloghdr" struct from if_pflog.h.

* Mark some __unused variables.

Summary of changes:
 sys/net/pf/if_pflog.c | 84 +++
 sys/net/pf/if_pflog.h | 11 ---
 2 files changed, 37 insertions(+), 58 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a6ccd68b08eff10c57551f8fe92f39a5b8ae6c48


-- 
DragonFly BSD source repository


git: if_pfsync: Depend on "pf" module and some cleanups

2018-08-08 Thread Aaron LI


commit c8f430ba934ae95fab35e5ea90b7092b6805837e
Author: Aaron LI 
Date:   Thu Jun 21 09:40:05 2018 +0800

if_pfsync: Depend on "pf" module and some cleanups

* Explicitly depend on the "pf" module to make sure it is initialized
  later.

* Remove the unnecessary ksnprintf directive that sets if_xname.

* Order several directives in pfsync_clone_create(), making it more
  consistent with pflog_clone_create().

Summary of changes:
 sys/net/pf/if_pfsync.c | 21 +++--
 1 file changed, 11 insertions(+), 10 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/c8f430ba934ae95fab35e5ea90b7092b6805837e


-- 
DragonFly BSD source repository


git: pf.conf.5: Describe the use of interface group

2018-08-08 Thread Aaron LI


commit 5304134c9c97d9ff22e6c3ddc4dde7ccb3895cde
Author: Aaron LI 
Date:   Tue Jun 26 13:42:42 2018 +0800

pf.conf.5: Describe the use of interface group

Add the description on interface group, which is supported by DragonFly
BSD's PF now.

Meanwhile, bring in many small updates/fixes from FreeBSD.

Summary of changes:
 share/man/man5/pf.conf.5 | 94 
 1 file changed, 56 insertions(+), 38 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5304134c9c97d9ff22e6c3ddc4dde7ccb3895cde


-- 
DragonFly BSD source repository


git: net: Tweak some styles and comments

2018-08-08 Thread Aaron LI


commit 2949c680adb831996c4c170affac4f493c3de188
Author: Aaron LI 
Date:   Thu Jun 21 13:56:00 2018 +0800

net: Tweak some styles and comments

Summary of changes:
 sys/net/if.c  | 13 +++--
 sys/net/if_var.h  | 32 +++-
 sys/net/pf/pf_if.c|  2 +-
 sys/net/pf/pf_ioctl.c |  7 ---
 sys/net/pf/pfvar.h| 28 ++--
 sys/net/route.c   |  4 ++--
 sys/net/route.h   |  3 +--
 sys/sys/sockio.h  | 22 +++---
 8 files changed, 55 insertions(+), 56 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/2949c680adb831996c4c170affac4f493c3de188


-- 
DragonFly BSD source repository


git: if_loop: Use ifc->ifc_name and minor cleanups

2018-08-08 Thread Aaron LI


commit 426d6ad04af3385f289cad4f7b0a68148573b0e5
Author: Aaron LI 
Date:   Thu Jun 21 13:49:15 2018 +0800

if_loop: Use ifc->ifc_name and minor cleanups

* Use "ifc->ifc_name" instead of explicit "lo".

* Minor style updates.

Summary of changes:
 sys/net/if_loop.c | 13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/426d6ad04af3385f289cad4f7b0a68148573b0e5


-- 
DragonFly BSD source repository


git: if_clone: Add cloned interface to the group of its device name

2018-08-08 Thread Aaron LI


commit 5e983a2e81a369a995ee9cb7d8bcecf766990863
Author: Aaron LI 
Date:   Thu Jun 21 14:40:31 2018 +0800

if_clone: Add cloned interface to the group of its device name

When a new interface is cloned, add it to the group of its device name,
e.g., cloned interfaces tapX will belong to group of "tap" by default.

Summary of changes:
 sys/net/if_clone.c | 10 ++
 1 file changed, 10 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/5e983a2e81a369a995ee9cb7d8bcecf766990863


-- 
DragonFly BSD source repository


git: if_clone: Remove useless code wrongly added in 84cb91c376f

2018-08-08 Thread Aaron LI


commit 1e4b15c7af1048818778718cff71b98ff6cf252b
Author: Aaron LI 
Date:   Mon Aug 6 00:09:53 2018 +0800

if_clone: Remove useless code wrongly added in 84cb91c376f

The code was inteded to obtain the created interface and add an
interface group for it, which is a work in progress.

Summary of changes:
 sys/net/if_clone.c | 6 --
 1 file changed, 6 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1e4b15c7af1048818778718cff71b98ff6cf252b


-- 
DragonFly BSD source repository


git: if_clone: Refactor out if_clone_{alloc,free}_unit() functions

2018-08-08 Thread Aaron LI


commit 9ad42ca200d2153e8f3d9b86928684884d283da3
Author: Aaron LI 
Date:   Mon Aug 6 00:10:54 2018 +0800

if_clone: Refactor out if_clone_{alloc,free}_unit() functions

Refactor out if_clone_{alloc,free}_unit() functions from
if_clone_{create,destroy}() functions.

Summary of changes:
 sys/net/if_clone.c | 120 +++--
 1 file changed, 70 insertions(+), 50 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/9ad42ca200d2153e8f3d9b86928684884d283da3


-- 
DragonFly BSD source repository


git: if_clone: Check cloner name to avoid duplicate in if_clone_attach()

2018-08-08 Thread Aaron LI


commit 595dc8f18c44a1d14a2b0b9b6ba2485cee04d3b5
Author: Aaron LI 
Date:   Mon Aug 6 00:34:25 2018 +0800

if_clone: Check cloner name to avoid duplicate in if_clone_attach()

Change if_clone_attach() to check the cloner name instead of the pointer
to avoid duplicate, also to return EEXIST instead of panic.

Summary of changes:
 sys/net/if_clone.c | 14 +-
 sys/net/if_clone.h |  2 +-
 2 files changed, 6 insertions(+), 10 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/595dc8f18c44a1d14a2b0b9b6ba2485cee04d3b5


-- 
DragonFly BSD source repository


git: if_clone: Refactor out if_clone_createif() function

2018-08-08 Thread Aaron LI


commit 1047b69ec58e788e95845d6a577152a68e9d6601
Author: Aaron LI 
Date:   Mon Aug 6 15:36:41 2018 +0800

if_clone: Refactor out if_clone_createif() function

The new if_clone_createif() function will create a clone interface
with the given cloner and unit.

Summary of changes:
 sys/net/if_clone.c | 52 +++-
 1 file changed, 35 insertions(+), 17 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/1047b69ec58e788e95845d6a577152a68e9d6601


-- 
DragonFly BSD source repository


Re: git: if_tun: Use pointer to ifnet in tun_softc struct

2018-07-19 Thread Aaron LI
On Fri, 20 Jul 2018 09:40:21 +0800
Sepherosa Ziehau  wrote:

> Most of the physical drivers are ethernet ones, so they need arpcom;
> please do w/ care.

Sure, I have to understand the drivers more before really touching them.

> I am not quite sure why we want to use if_alloc() in the first place?

Since our if_alloc() is very simple, so there is no big benefit to use it
over the direct kmalloc().  But if_alloc() is easier to use and more
intuitive.

> We don't have the synchronization issue if_alloc() tries to address
> in FreeBSD.

Cool!


Cheers,
-- 
Aaron


pgpLus5jRHfkV.pgp
Description: OpenPGP digital signature


Re: git: if_tun: Use pointer to ifnet in tun_softc struct

2018-07-19 Thread Aaron LI
OK, thanks.

I'll keep looking at the net code, and can improve it later.


On Fri, 20 Jul 2018 12:07:00 +0800
Sepherosa Ziehau  wrote:

> Well, I don't think if_alloc makes sense for Dfly.  But if you have
> already changed some code, then let it be.
> 
> On Fri, Jul 20, 2018 at 11:19 AM, Aaron LI  wrote:
> > On Fri, 20 Jul 2018 10:43:16 +0800
> > Sepherosa Ziehau  wrote:
> >  
> >> On Fri, Jul 20, 2018 at 10:19 AM, Aaron LI  wrote:  
> >> > On Fri, 20 Jul 2018 09:40:21 +0800
> >> > Sepherosa Ziehau  wrote:
> >> >  
> >> >> I am not quite sure why we want to use if_alloc() in the first
> >> >> place?  
> >> >
> >> > Since our if_alloc() is very simple, so there is no big benefit to use
> >> > it over the direct kmalloc().  But if_alloc() is easier to use and more
> >> > intuitive.  
> >>
> >> I mean why allocate in the first place?  What's wrong w/ embedding?  
> >
> > There is nothing wrong with embedding ifnet inside tun_softc.
> >
> > So do you think is it better to embed or not embed the ifnet?  I'll follow
> > your advice.  Thanks.
> >



pgpQitKq0b_9i.pgp
Description: OpenPGP digital signature


Re: git: if_tun: Use pointer to ifnet in tun_softc struct

2018-07-19 Thread Aaron LI
On Fri, 20 Jul 2018 10:43:16 +0800
Sepherosa Ziehau  wrote:

> On Fri, Jul 20, 2018 at 10:19 AM, Aaron LI  wrote:
> > On Fri, 20 Jul 2018 09:40:21 +0800
> > Sepherosa Ziehau  wrote:
> >  
> >> I am not quite sure why we want to use if_alloc() in the first place?  
> >
> > Since our if_alloc() is very simple, so there is no big benefit to use it
> > over the direct kmalloc().  But if_alloc() is easier to use and more
> > intuitive.  
> 
> I mean why allocate in the first place?  What's wrong w/ embedding?

There is nothing wrong with embedding ifnet inside tun_softc.

So do you think is it better to embed or not embed the ifnet?  I'll follow
your advice.  Thanks.


-- 
Aaron


pgpQlhCi0J2El.pgp
Description: OpenPGP digital signature


Re: git: if_tun: Use pointer to ifnet in tun_softc struct

2018-07-19 Thread Aaron LI
On Fri, 20 Jul 2018 09:09:07 +0800
Sepherosa Ziehau  wrote:

> Just panic if_com_alloc[type]() fails.
> 

Ok, I'll do it.  I'll also look at the drivers to make them use if_alloc()
and if_free() when appropriate.


Cheers,
-- 
Aaron


pgppTtS70LbYz.pgp
Description: OpenPGP digital signature


git: if_tap: Destroy the autoclone device when unload module

2018-07-17 Thread Aaron LI


commit a77c4ded301e67d4185b9228fbcb26ba74c09b55
Author: Aaron LI 
Date:   Sun Jul 8 12:30:55 2018 +0800

if_tap: Destroy the autoclone device when unload module

Use destroy_autoclone_dev(), which replaces both devfs_clone_handler_del()
and devfs_clone_bitmap_uninit(), to destroy the autoclone device /dev/tap
when unload the module.

Without this fix, the autoclone device /dev/tap is left over when the
module is unloaded.

Summary of changes:
 sys/net/tap/if_tap.c | 17 +
 1 file changed, 5 insertions(+), 12 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/a77c4ded301e67d4185b9228fbcb26ba74c09b55


-- 
DragonFly BSD source repository


git: if_tap: Add read-only sysctl net.link.tap.refcnt

2018-07-17 Thread Aaron LI


commit f6efdc20c8dd2bfbdb1f8d88dd5154c4a1846131
Author: Aaron LI 
Date:   Sun Jul 8 10:05:31 2018 +0800

if_tap: Add read-only sysctl net.link.tap.refcnt

Expose the number of opened devices as a read-only sysctl:
net.link.tap.refcnt.

Improve the debug messages with respect to the refcnt.

Summary of changes:
 sys/net/tap/if_tap.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f6efdc20c8dd2bfbdb1f8d88dd5154c4a1846131


-- 
DragonFly BSD source repository


git: if_tap: Remove the broken vmnet support

2018-07-17 Thread Aaron LI


commit ad592396e62fe7ef868d5cf3111fb93ce3020f94
Author: Aaron LI 
Date:   Fri Jul 13 13:04:35 2018 +0800

if_tap: Remove the broken vmnet support

The vmnet feature provided by tap(4) was intended to be used by the
VMWare port that runs as the server side to communicate with its clients.
However, our tap(4) was updated a lot in the past but left the vmnet
function broken.  In addition, we don't have the VMWare server and thus
the vmnet function isn't needed in the foreseeable future.
So just remove it.

Discussed-with: swildner, sephe

Summary of changes:
 share/man/man4/tap.4| 89 ++---
 sys/net/tap/if_tap.c| 60 +
 sys/net/tap/if_tap.h| 14 
 sys/net/tap/if_tapvar.h |  7 ++--
 sys/sys/param.h |  3 +-
 5 files changed, 17 insertions(+), 156 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/ad592396e62fe7ef868d5cf3111fb93ce3020f94


-- 
DragonFly BSD source repository


git: if_tap: Update tap.4 man page to match the code

2018-07-17 Thread Aaron LI


commit f892bb77a871d61424d8de69d00ff4989f595f16
Author: Aaron LI 
Date:   Mon Jul 9 18:53:42 2018 +0800

if_tap: Update tap.4 man page to match the code

Remove the description on FIONBIO ioctl since ours doesn't support it.

Mainly taken from FreeBSD, with some improvements.

Summary of changes:
 share/man/man4/tap.4 | 146 +--
 1 file changed, 106 insertions(+), 40 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/f892bb77a871d61424d8de69d00ff4989f595f16


-- 
DragonFly BSD source repository


git: if_tap: Return error instead of system panic

2018-07-17 Thread Aaron LI


commit fba81a1c19f7e2d4ab3b6a9c9c74a3f99b21b5b5
Author: Aaron LI 
Date:   Sun Jul 8 16:37:24 2018 +0800

if_tap: Return error instead of system panic

Return error when failed to create/find the device and to allocate
the interface struct, instead of system panic.

Summary of changes:
 sys/net/tap/if_tap.c | 28 ++--
 1 file changed, 18 insertions(+), 10 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/fba81a1c19f7e2d4ab3b6a9c9c74a3f99b21b5b5


-- 
DragonFly BSD source repository


  1   2   3   4   5   6   7   >