svn commit: r363140 - head/usr.bin/mkimg

2020-07-12 Thread Oleksandr Tymoshenko
Author: gonzo
Date: Mon Jul 13 02:24:31 2020
New Revision: 363140
URL: https://svnweb.freebsd.org/changeset/base/363140

Log:
  Fix invalid VHDX generation for image larger than 4Gb
  
  - Part of BAT payload location was lost due to invalid
  BAT entry encoding type (32 bits instead of 64 bits)
  - The sequence of PB/SB entries in BAT was broken due to
  off-by-one index check. It worked for smaller than
  4Gb because there were no SB entries in BAT.
  
  MFC after:1 day

Modified:
  head/usr.bin/mkimg/vhdx.c

Modified: head/usr.bin/mkimg/vhdx.c
==
--- head/usr.bin/mkimg/vhdx.c   Mon Jul 13 02:09:21 2020(r363139)
+++ head/usr.bin/mkimg/vhdx.c   Mon Jul 13 02:24:31 2020(r363140)
@@ -429,7 +429,7 @@ vhdx_write_bat(int fd, uint64_t image_size)
payload_offset = 3 + (bat_size / SIZE_1MB);
bat_ptr = 0;
for (idx = 0; idx < data_block_count; idx++) {
-   le32enc(bat + bat_ptr,
+   le64enc(bat + bat_ptr,
BAT_ENTRY(payload_offset, PAYLOAD_BLOCK_FULLY_PRESENT));
bat_ptr += 8;
payload_offset += (PAYLOAD_BLOCK_SIZE / SIZE_1MB);
@@ -445,9 +445,9 @@ vhdx_write_bat(int fd, uint64_t image_size)
bat_ptr = 0;
}
 
-   if ((idx % chunk_ratio) == 0 &&
-   (idx > 0) && (idx != data_block_count - 1)) {
-   le32enc(bat + bat_ptr,
+   if (((idx + 1) % chunk_ratio) == 0 &&
+   (idx != data_block_count - 1)) {
+   le64enc(bat + bat_ptr,
BAT_ENTRY(0, SB_BLOCK_NOT_PRESENT));
bat_ptr += 8;
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363139 - head/stand/man

2020-07-12 Thread Allan Jude
Author: allanjude
Date: Mon Jul 13 02:09:21 2020
New Revision: 363139
URL: https://svnweb.freebsd.org/changeset/base/363139

Log:
  Loader: explain the syntax of currdev
  
  The origin text was: "Syntax for devices is odd."
  That is not very helpful.
  
  PR:   199103
  Reviewed by:  kevans, tsoome
  Sponsored by: Klara Inc.
  Event:July 2020 Bugathon
  Differential Revision:https://reviews.freebsd.org/D25629

Modified:
  head/stand/man/loader.8

Modified: head/stand/man/loader.8
==
--- head/stand/man/loader.8 Mon Jul 13 01:32:37 2020(r363138)
+++ head/stand/man/loader.8 Mon Jul 13 02:09:21 2020(r363139)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd August 15, 2018
+.Dd July 11, 2020
 .Dt LOADER 8
 .Os
 .Sh NAME
@@ -479,8 +479,14 @@ In that case, the first listed console will become the
 userland output (e.g.\& from
 .Xr init 8 ) .
 .It Va currdev
-Selects the default device.
-Syntax for devices is odd.
+Selects the default device to loader the kernel from.
+The syntax is:
+.Dl Ic loader_device:
+or
+.Dl Ic zfs:dataset:
+Examples:
+.Dl Ic disk0p2:
+.Dl Ic zfs:zroot/ROOT/default:
 .It Va dumpdev
 Sets the device for kernel dumps.
 This can be used to ensure that a device is configured before the corresponding
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363138 - head/usr.bin/sed/tests

2020-07-12 Thread Yuri Pankov
Author: yuripv
Date: Mon Jul 13 01:32:37 2020
New Revision: 363138
URL: https://svnweb.freebsd.org/changeset/base/363138

Log:
  sed/multi_test: print comment for current test, not next one
  
  This is visible when e.g. 8.20 is failing:
  
  not ok 96 8.20 # \ in y command
  
  8.20's comment should be '[ as an s delimiter and its escapes'.

Modified:
  head/usr.bin/sed/tests/multi_test.sh

Modified: head/usr.bin/sed/tests/multi_test.sh
==
--- head/usr.bin/sed/tests/multi_test.shMon Jul 13 01:28:45 2020
(r363137)
+++ head/usr.bin/sed/tests/multi_test.shMon Jul 13 01:32:37 2020
(r363138)
@@ -92,9 +92,9 @@ result()
cp current.out $REGRESS/${TESTNAME}
fi
if diff -c $REGRESS/${TESTNAME} current.out ; then
-   echo "ok $MARK $TESTNAME # $TODO$COMMENT"
+   echo "ok $MARK $TESTNAME # $TODO$OCOMMENT"
else
-   echo "not ok $MARK $TESTNAME # $TODO$COMMENT"
+   echo "not ok $MARK $TESTNAME # $TODO$OCOMMENT"
fi 1>&4 2>&5
 }
 
@@ -102,6 +102,7 @@ result()
 mark()
 {
[ $MARK -gt 0 ] && result
+   OCOMMENT=$COMMENT
MARK=`expr $MARK + 1`
TESTNAME=$1
exec 1>&4 2>&5
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363137 - head/sys/fs/nfsclient

2020-07-12 Thread Rick Macklem
Author: rmacklem
Date: Mon Jul 13 01:28:45 2020
New Revision: 363137
URL: https://svnweb.freebsd.org/changeset/base/363137

Log:
  Minor code cleanup that removes "nd->nd_bpos = mcp;" in both if and else.
  
  The statement "nd->nd_bpos = mcp;" was in both the if and else. Correct,
  but potentially confusing.  This patch fixes this.
  
  There should be no semantics change caused by this commit.

Modified:
  head/sys/fs/nfsclient/nfs_clcomsubs.c

Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c
==
--- head/sys/fs/nfsclient/nfs_clcomsubs.c   Sun Jul 12 20:59:52 2020
(r363136)
+++ head/sys/fs/nfsclient/nfs_clcomsubs.c   Mon Jul 13 01:28:45 2020
(r363137)
@@ -145,13 +145,12 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui
for (left = 0; left < rem; left++)
*mcp++ = '\0';
mp->m_len += rem;
-   nd->nd_bpos = mcp;
if ((nd->nd_flag & ND_EXTPG) != 0) {
nd->nd_bextpgsiz -= rem;
mp->m_epg_last_len += rem;
}
-   } else
-   nd->nd_bpos = mcp;
+   }
+   nd->nd_bpos = mcp;
nd->nd_mb = mp;
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r363125 - head/sys/compat/linux

2020-07-12 Thread Conrad Meyer
Hi Alexander,

On Sun, Jul 12, 2020 at 2:51 AM Alexander Leidinger
 wrote:
>
> Author: netchild
> Date: Sun Jul 12 09:51:09 2020
> New Revision: 363125
> URL: https://svnweb.freebsd.org/changeset/base/363125
>
> Log:
>   Implement CLOCK_MONOTONIC_RAW (linux >= 2.6.28).
>
>   It is documented as a raw hardware-based clock not subject to NTP or
>   incremental adjustments. With this "not as precise as CLOCK_MONOTONIC"
>   description in mind, map it to our CLOCK_MONOTNIC_FAST (the same
>   mapping as for the linux CLOCK_MONOTONIC_COARSE).

Can you point at the documentation suggesting CLOCK_MONOTONIC_RAW is
any less precise than CLOCK_MONOTONIC?  I'm looking at the Linux
manual page and it does not seem to contain any language to that
effect.

>   This is needed for the webcomponent of steam (chromium) and some
>   other steam component or game.
>
>   The linux-steam-utils port contains a LD_PRELOAD based fix for this.
>   There this is mapped to CLOCK_MONOTONIC.
>   As an untrained ear/eye (= the majority of people) is normaly not
>   noticing a difference of jitter in the 10-20 ms range, specially
>   if you don't pay attention like for example in a browser session
>   while watching a video stream, the mapping to CLOCK_MONOTONIC_FAST
>   seems more appropriate than to CLOCK_MONOTONIC.

I don't know how these programs use the clock, but 10-20 ms of jitter
in the UI is noticeable to even casual users.  (In FreeBSD these
functions are purportedly accurate to 1 timer tick, which is 1ms on
HZ=1000 (amd64) — much better than 10-20ms.)  However, I'm concerned
this is still insufficient precision compared with the documented
behavior of the Linux functions.  I think regular CLOCK_MONOTONIC is
the closest thing we've got to Linux's CLOCK_MONOTONIC_RAW.  The Linux
analog of _FAST is _COARSE.

Best,
Conrad
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363136 - head/usr.bin/xinstall

2020-07-12 Thread Eugene Grosbein
Author: eugen
Date: Sun Jul 12 20:59:52 2020
New Revision: 363136
URL: https://svnweb.freebsd.org/changeset/base/363136

Log:
  install(1): another correction after r363064
  
  Make sure we call fsync(2) on strip result
  in case of "safecopy" and "strip -o tempcopy -- src"
  before renaming tempcopy to destination.
  
  MFC after:3 weeks
  X-MFC-With:   r363064

Modified:
  head/usr.bin/xinstall/xinstall.c

Modified: head/usr.bin/xinstall/xinstall.c
==
--- head/usr.bin/xinstall/xinstall.cSun Jul 12 19:39:56 2020
(r363135)
+++ head/usr.bin/xinstall/xinstall.cSun Jul 12 20:59:52 2020
(r363136)
@@ -147,7 +147,7 @@ static void install_dir(char *);
 static voidmetadata_log(const char *, const char *, struct timespec *,
const char *, const char *, off_t);
 static int parseid(const char *, id_t *);
-static int strip(const char *, const char *, char **);
+static int strip(const char *, int, const char *, char **);
 static int trymmap(int);
 static voidusage(void);
 
@@ -862,7 +862,7 @@ install(const char *from_name, const char *to_name, u_
if (!devnull) {
if (dostrip)
stripped = strip(tempcopy ? tempfile : to_name,
-from_name, );
+   to_fd, from_name, );
if (!stripped)
digestresult = copy(from_fd, from_name, to_fd,
tempcopy ? tempfile : to_name, from_sb.st_size);
@@ -871,8 +871,8 @@ install(const char *from_name, const char *to_name, u_
 
if (dostrip) {
if (!stripped)
-   (void)strip(tempcopy ? tempfile : to_name, NULL,
-   );
+   (void)strip(tempcopy ? tempfile : to_name, to_fd,
+   NULL, );
 
/*
 * Re-open our fd on the target, in case
@@ -1310,17 +1310,18 @@ copy(int from_fd, const char *from_name, int to_fd, co
 /*
  * strip --
  * Use strip(1) to strip the target file.
- * Just invoke strip(1) on to_name if from_name is NULL,
- * else try to run "strip -o to_name -- from_name" and return 0 on failure.
- * Return 1 on success and assign result of digest_file(to_name) to *dresp.
+ * Just invoke strip(1) on to_name if from_name is NULL, else try
+ * to run "strip -o to_name -- from_name" and return 0 on failure.
+ * Return 1 on success and assign result of digest_file(to_name)
+ * to *dresp.
  */
 static int
-strip(const char *to_name, const char *from_name, char **dresp)
+strip(const char *to_name, int to_fd, const char *from_name, char **dresp)
 {
const char *stripbin;
const char *args[6];
pid_t pid;
-   int error, status;
+   int error, serrno, status;
 
stripbin = getenv("STRIPBIN");
if (stripbin == NULL)
@@ -1355,6 +1356,12 @@ strip(const char *to_name, const char *from_name, char
(void)unlink(to_name);
errx(EX_SOFTWARE, "strip command %s failed on %s",
stripbin, to_name);
+   }
+   if (from_name != NULL && safecopy && fsync(to_fd) == -1) {
+   serrno = errno;
+   (void)unlink(to_name);
+   errno = serrno;
+   err(EX_OSERR, "fsync failed for %s", to_name);
}
if (dresp != NULL)
*dresp = digest_file(to_name);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363135 - in stable/11: crypto/heimdal/lib/krb5 sbin/rcorder

2020-07-12 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Sun Jul 12 19:39:56 2020
New Revision: 363135
URL: https://svnweb.freebsd.org/changeset/base/363135

Log:
  MFC 362491:
  
  Improve the rcorder manual page
  
  - Fix formatting issues such as:
- Use Ql instead of Dq Li as Li is deprecated
- Address some mandoc warnings
  - Add arguments missing from the list of options (i.e., document "-k keep"
instead of just "-k").
  - Document that -k and -s can be specified multiple times
  - Use sshd instead of named for the example in the BUGS section, as named
is not in the base system. Also, use Nm instead of Xr there as it is not
the sshd binary that is required to be running, but the service.
  - Use Sy instead of Cm for KEYWORDS. Cm is reserved for command-line
modifiers of the CLI.
  - Add an EXAMPLES section
  - Cross-reference service(8).

Modified:
  stable/11/crypto/heimdal/lib/krb5/krb5.conf.5
  stable/11/sbin/rcorder/rcorder.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/crypto/heimdal/lib/krb5/krb5.conf.5
==
--- stable/11/crypto/heimdal/lib/krb5/krb5.conf.5   Sun Jul 12 19:39:17 
2020(r363134)
+++ stable/11/crypto/heimdal/lib/krb5/krb5.conf.5   Sun Jul 12 19:39:56 
2020(r363135)
@@ -257,7 +257,7 @@ Setting this flag to
 make it store the MIT way, this is default for Heimdal 0.7.
 .It Li check-rd-req-server
 If set to "ignore", the framework will ignore any the server input to
-.Xr krb5_rd_req 3,
+.Xr krb5_rd_req 3 ,
 this is very useful when the GSS-API server input the
 wrong server name into the gss_accept_sec_context call.
 .El

Modified: stable/11/sbin/rcorder/rcorder.8
==
--- stable/11/sbin/rcorder/rcorder.8Sun Jul 12 19:39:17 2020
(r363134)
+++ stable/11/sbin/rcorder/rcorder.8Sun Jul 12 19:39:56 2020
(r363135)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 27, 2018
+.Dd June 22, 2020
 .Dt RCORDER 8
 .Os
 .Sh NAME
@@ -62,30 +62,30 @@ and which indicate, for each file, which
 may be expected to be filled by that file.
 .Pp
 Within each file, a block containing a series of
-.Dq Li REQUIRE ,
-.Dq Li PROVIDE ,
-.Dq Li BEFORE
+.Ql REQUIRE ,
+.Ql PROVIDE ,
+.Ql BEFORE
 and
-.Dq Li KEYWORD
+.Ql KEYWORD
 lines must appear.
 The format of the lines is rigid.
 Each line must begin with a single
 .Ql # ,
 followed by a single space, followed by
-.Dq Li PROVIDE: ,
-.Dq Li REQUIRE: ,
-.Dq Li BEFORE: ,
+.Ql PROVIDE\&: ,
+.Ql REQUIRE\&: ,
+.Ql BEFORE\&: ,
 or
-.Dq Li KEYWORD: .
+.Ql KEYWORD\&: .
 No deviation is permitted.
 Each dependency line is then followed by a series of conditions,
 separated by whitespace.
 Multiple
-.Dq Li PROVIDE ,
-.Dq Li REQUIRE ,
-.Dq Li BEFORE
+.Ql PROVIDE ,
+.Ql REQUIRE ,
+.Ql BEFORE
 and
-.Dq Li KEYWORD
+.Ql KEYWORD
 lines may appear, but all such lines must appear in a sequence without
 any intervening lines, as once a line that does not follow the format
 is reached, parsing stops.
@@ -94,19 +94,21 @@ is reached, parsing stops.
 .\" that they can be deprecated at some point in the future.
 .Pp
 The options are as follows:
-.Bl -tag -width indent
-.It Fl k
+.Bl -tag -width "-k keep"
+.It Fl k Ar keep
 Add the specified keyword to the
 .Dq "keep list" .
 If any
 .Fl k
 option is given, only those files containing the matching keyword are listed.
-.It Fl s
+This option can be specified multiple times.
+.It Fl s Ar skip
 Add the specified keyword to the
 .Dq "skip list" .
 If any
 .Fl s
 option is given, files containing the matching keyword are not listed.
+This option can be specified multiple times.
 .El
 .Pp
 An example block follows:
@@ -117,20 +119,20 @@ An example block follows:
 .Ed
 .Pp
 This block states that the file in which it appears depends upon the
-.Dq Li networking ,
-.Dq Li syslog ,
+.Ql networking ,
+.Ql syslog ,
 and
-.Dq Li usr
+.Ql usr
 conditions, and provides the
-.Dq Li dns
+.Ql dns
 and
-.Dq Li nscd
+.Ql nscd
 conditions.
 .Pp
 A file may contain zero
-.Dq Li PROVIDE
+.Ql PROVIDE
 lines, in which case it provides no conditions, and may contain zero
-.Dq Li REQUIRE
+.Ql REQUIRE
 lines, in which case it has no dependencies.
 There must be at least one file with no dependencies in the set of
 arguments passed to
@@ -140,19 +142,36 @@ in order for it to find a starting place in the depend
 There are several
 .Em KEYWORDs
 in use:
-.Bl -tag -width ".Cm shutdown" -offset indent
-.It Cm firstboot, nojail, nojailvnet, nostart
+.Bl -tag -width "shutdown" -offset indent
+.It Sy firstboot , nojail , nojailvnet , nostart
 Used by
 .Xr rc 8 .
-.It Cm resume
+.It Sy resume
 Used by
 .Nm /etc/rc.resume
 (see
 .Xr acpiconf 8 )
-.It Cm shutdown
+.It Sy shutdown
 Used by
 .Xr rc.shutdown 8 .
 .El
+.Sh EXAMPLES
+Print the dependency ordering of the services from the base system and
+.Xr ports 7 :
+.Bd -literal -offset indent
+$ 

svn commit: r363134 - stable/12/sbin/rcorder

2020-07-12 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Sun Jul 12 19:39:17 2020
New Revision: 363134
URL: https://svnweb.freebsd.org/changeset/base/363134

Log:
  MFC 362491:
  
  Improve the rcorder manual page
  
  - Fix formatting issues such as:
- Use Ql instead of Dq Li as Li is deprecated
- Address some mandoc warnings
  - Add arguments missing from the list of options (i.e., document "-k keep"
instead of just "-k").
  - Document that -k and -s can be specified multiple times
  - Use sshd instead of named for the example in the BUGS section, as named
is not in the base system. Also, use Nm instead of Xr there as it is not
the sshd binary that is required to be running, but the service.
  - Use Sy instead of Cm for KEYWORDS. Cm is reserved for command-line
modifiers of the CLI.
  - Add an EXAMPLES section
  - Cross-reference service(8).

Modified:
  stable/12/sbin/rcorder/rcorder.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/rcorder/rcorder.8
==
--- stable/12/sbin/rcorder/rcorder.8Sun Jul 12 18:34:09 2020
(r363133)
+++ stable/12/sbin/rcorder/rcorder.8Sun Jul 12 19:39:17 2020
(r363134)
@@ -31,7 +31,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 27, 2018
+.Dd June 22, 2020
 .Dt RCORDER 8
 .Os
 .Sh NAME
@@ -62,30 +62,30 @@ and which indicate, for each file, which
 may be expected to be filled by that file.
 .Pp
 Within each file, a block containing a series of
-.Dq Li REQUIRE ,
-.Dq Li PROVIDE ,
-.Dq Li BEFORE
+.Ql REQUIRE ,
+.Ql PROVIDE ,
+.Ql BEFORE
 and
-.Dq Li KEYWORD
+.Ql KEYWORD
 lines must appear.
 The format of the lines is rigid.
 Each line must begin with a single
 .Ql # ,
 followed by a single space, followed by
-.Dq Li PROVIDE: ,
-.Dq Li REQUIRE: ,
-.Dq Li BEFORE: ,
+.Ql PROVIDE\&: ,
+.Ql REQUIRE\&: ,
+.Ql BEFORE\&: ,
 or
-.Dq Li KEYWORD: .
+.Ql KEYWORD\&: .
 No deviation is permitted.
 Each dependency line is then followed by a series of conditions,
 separated by whitespace.
 Multiple
-.Dq Li PROVIDE ,
-.Dq Li REQUIRE ,
-.Dq Li BEFORE
+.Ql PROVIDE ,
+.Ql REQUIRE ,
+.Ql BEFORE
 and
-.Dq Li KEYWORD
+.Ql KEYWORD
 lines may appear, but all such lines must appear in a sequence without
 any intervening lines, as once a line that does not follow the format
 is reached, parsing stops.
@@ -94,19 +94,21 @@ is reached, parsing stops.
 .\" that they can be deprecated at some point in the future.
 .Pp
 The options are as follows:
-.Bl -tag -width indent
-.It Fl k
+.Bl -tag -width "-k keep"
+.It Fl k Ar keep
 Add the specified keyword to the
 .Dq "keep list" .
 If any
 .Fl k
 option is given, only those files containing the matching keyword are listed.
-.It Fl s
+This option can be specified multiple times.
+.It Fl s Ar skip
 Add the specified keyword to the
 .Dq "skip list" .
 If any
 .Fl s
 option is given, files containing the matching keyword are not listed.
+This option can be specified multiple times.
 .El
 .Pp
 An example block follows:
@@ -117,20 +119,20 @@ An example block follows:
 .Ed
 .Pp
 This block states that the file in which it appears depends upon the
-.Dq Li networking ,
-.Dq Li syslog ,
+.Ql networking ,
+.Ql syslog ,
 and
-.Dq Li usr
+.Ql usr
 conditions, and provides the
-.Dq Li dns
+.Ql dns
 and
-.Dq Li nscd
+.Ql nscd
 conditions.
 .Pp
 A file may contain zero
-.Dq Li PROVIDE
+.Ql PROVIDE
 lines, in which case it provides no conditions, and may contain zero
-.Dq Li REQUIRE
+.Ql REQUIRE
 lines, in which case it has no dependencies.
 There must be at least one file with no dependencies in the set of
 arguments passed to
@@ -140,19 +142,36 @@ in order for it to find a starting place in the depend
 There are several
 .Em KEYWORDs
 in use:
-.Bl -tag -width ".Cm shutdown" -offset indent
-.It Cm firstboot, nojail, nojailvnet, nostart
+.Bl -tag -width "shutdown" -offset indent
+.It Sy firstboot , nojail , nojailvnet , nostart
 Used by
 .Xr rc 8 .
-.It Cm resume
+.It Sy resume
 Used by
 .Nm /etc/rc.resume
 (see
 .Xr acpiconf 8 )
-.It Cm shutdown
+.It Sy shutdown
 Used by
 .Xr rc.shutdown 8 .
 .El
+.Sh EXAMPLES
+Print the dependency ordering of the services from the base system and
+.Xr ports 7 :
+.Bd -literal -offset indent
+$ rcorder /etc/rc.d/* /usr/local/etc/rc.d/*
+.Ed
+.Pp
+Count the number of services in the base system, which specify the
+.Sy shutdown
+keyword, while skipping those with
+.Sy firstboot
+and
+.Sy nojailvnet :
+.Bd -literal -offset indent
+$ rcorder -k nostart -s firstboot -s nojailvnet /etc/rc.d/*  | wc -l
+   3
+.Ed
 .Sh DIAGNOSTICS
 The
 .Nm
@@ -161,9 +180,9 @@ status if it encounters an error while processing the 
 .Bl -diag
 .It "Requirement %s has no providers, aborting."
 No file has a
-.Dq Li PROVIDE
+.Ql PROVIDE
 line corresponding to a condition present in a
-.Dq Li REQUIRE
+.Ql REQUIRE
 line in another file.
 .It "Circular dependency on provision %s, aborting."
 A set of files has a circular dependency which was 

svn commit: r363133 - head/sys/netinet

2020-07-12 Thread Michael Tuexen
Author: tuexen
Date: Sun Jul 12 18:34:09 2020
New Revision: 363133
URL: https://svnweb.freebsd.org/changeset/base/363133

Log:
  Cleanup, no functional change intended.
  
  This file is only compiled if INET or INET6 is defined. So there
  is no need for checking that.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D25635

Modified:
  head/sys/netinet/sctp_syscalls.c

Modified: head/sys/netinet/sctp_syscalls.c
==
--- head/sys/netinet/sctp_syscalls.cSun Jul 12 17:16:57 2020
(r363132)
+++ head/sys/netinet/sctp_syscalls.cSun Jul 12 18:34:09 2020
(r363133)
@@ -32,8 +32,6 @@
 __FBSDID("$FreeBSD$");
 
 #include "opt_capsicum.h"
-#include "opt_inet.h"
-#include "opt_inet6.h"
 #include "opt_sctp.h"
 #include "opt_ktrace.h"
 
@@ -139,8 +137,6 @@ sctp_syscalls_uninit(void)
 
 /*
  * SCTP syscalls.
- * Functionality only compiled in if SCTP is defined in the kernel Makefile,
- * otherwise all return EOPNOTSUPP.
  */
 int
 sys_sctp_peeloff(td, uap)
@@ -150,7 +146,6 @@ sys_sctp_peeloff(td, uap)
caddr_t name;
} */ *uap;
 {
-#if defined(INET) || defined(INET6)
struct file *headfp, *nfp = NULL;
struct socket *head, *so;
cap_rights_t rights;
@@ -212,7 +207,6 @@ done:
fdrop(headfp, td);
 done2:
return (error);
-#endif
 }
 
 int
@@ -228,7 +222,6 @@ sys_sctp_generic_sendmsg (td, uap)
int flags
} */ *uap;
 {
-#if defined(INET) || defined(INET6)
struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL;
struct socket *so;
struct file *fp = NULL;
@@ -323,7 +316,6 @@ sctp_bad:
 sctp_bad2:
free(to, M_SONAME);
return (error);
-#endif
 }
 
 int
@@ -339,7 +331,6 @@ sys_sctp_generic_sendmsg_iov(td, uap)
int flags
} */ *uap;
 {
-#if defined(INET) || defined(INET6)
struct sctp_sndrcvinfo sinfo, *u_sinfo = NULL;
struct socket *so;
struct file *fp = NULL;
@@ -451,7 +442,6 @@ sctp_bad1:
 sctp_bad2:
free(to, M_SONAME);
return (error);
-#endif
 }
 
 int
@@ -467,7 +457,6 @@ sys_sctp_generic_recvmsg(td, uap)
int *msg_flags
} */ *uap;
 {
-#if defined(INET) || defined(INET6)
uint8_t sockbufstore[256];
struct uio auio;
struct iovec *iov, *tiov;
@@ -597,5 +586,4 @@ out1:
fdrop(fp, td);
 
return (error);
-#endif
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r363088 - head/usr.bin/xinstall/tests

2020-07-12 Thread Enji Cooper


> On Jul 10, 2020, at 6:13 PM, Eugene Grosbein  wrote:
> 
> 11.07.2020 8:07, Eugene Grosbein wrote:
> 
 Fix the tests for install(1): add support for STRIPBIN's -o option.
>>> Is this feature now completely gone? Are binaries being stripped 
>>> properly in ports, etc?
> 
> Support for STRIPBIN has not changed. Stripping of ports etc. still works as 
> before, just more quick due to less I/O.

Eugene,
Got it! Thank you very much for the followup/additional information :).
Cheers!
-Enji
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r363103 - head/usr.sbin/bsdinstall/scripts

2020-07-12 Thread Enji Cooper

> On Jul 11, 2020, at 10:20 AM, Allan Jude  wrote:
> 
> Author: allanjude
> Date: Sat Jul 11 17:20:17 2020
> New Revision: 363103
> URL: https://svnweb.freebsd.org/changeset/base/363103
> 
> Log:
>  bsdinstall: only kill the dhclient for the interface we are restarting
> 
>  PR:  205821
>  Reported by: mjg
>  MFC after:   2 weeks
>  Sponsored by:Klara Inc.
>  Event:   July 2020 Bugathon
> 
> Modified:
>  head/usr.sbin/bsdinstall/scripts/netconfig_ipv4

Allan,
Thank you so very much for doing this!!! This has been an annoying 
nitpick of mine with sysinstall/bsdinstall, for many moons :).
It looks like equivalent logic doesn’t need to be implemented for IPv6. 
Yay :).
Cheers!
-Enji
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363132 - head/tests/sys/audit

2020-07-12 Thread Enji Cooper
Author: ngie
Date: Sun Jul 12 17:16:57 2020
New Revision: 363132
URL: https://svnweb.freebsd.org/changeset/base/363132

Log:
  Don't leave `path` behind when executing `:chflags_success`
  
  Prior to this change a `SF_IMMUTABLE` chflagsat(2)'ed file (`path`) was left
  behind, which sabotaged kyua(1) from being able to clean up the work 
directory,
  This resulted in unnecessary work for folks having to clean up the work
  directory on non-disposable systems, which defaults to `/tmp`. Use 
`UF_OFFLINE`
  instead of `SF_IMMUTABLE`, in part because setting `SF_IMMUTABLE` isn't 
relevant
  to the test and `SF_IMMUTABLE` cannot be cleared at all securelevels, as 
pointed
  out by @asomers.
  
  Additional work is required to catch cases like this upfront in the future to
  avoid tester headache. See PR # 247765 for more details/followup.
  
  Suggested by: asomers
  Reviewed By:  asomers, #tests
  MFC after:1 week
  PR:   247761
  Sponsored by: DellEMC
  Differential Revision: https://reviews.freebsd.org/D25561

Modified:
  head/tests/sys/audit/file-attribute-modify.c

Modified: head/tests/sys/audit/file-attribute-modify.c
==
--- head/tests/sys/audit/file-attribute-modify.cSun Jul 12 15:57:29 
2020(r363131)
+++ head/tests/sys/audit/file-attribute-modify.cSun Jul 12 17:16:57 
2020(r363132)
@@ -704,7 +704,7 @@ ATF_TC_BODY(chflagsat_success, tc)
/* File needs to exist to call chflagsat(2) */
ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1);
FILE *pipefd = setup(fds, auclass);
-   ATF_REQUIRE_EQ(0, chflagsat(AT_FDCWD, path, SF_IMMUTABLE, 0));
+   ATF_REQUIRE_EQ(0, chflagsat(AT_FDCWD, path, UF_OFFLINE, 0));
check_audit(fds, successreg, pipefd);
close(filedesc);
 }
@@ -726,7 +726,7 @@ ATF_TC_BODY(chflagsat_failure, tc)
 {
FILE *pipefd = setup(fds, auclass);
/* Failure reason: file does not exist */
-   ATF_REQUIRE_EQ(-1, chflagsat(AT_FDCWD, errpath, SF_IMMUTABLE, 0));
+   ATF_REQUIRE_EQ(-1, chflagsat(AT_FDCWD, errpath, UF_OFFLINE, 0));
check_audit(fds, failurereg, pipefd);
 }
 
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r363125 - head/sys/compat/linux

2020-07-12 Thread Alexander Leidinger via svn-src-all
Quoting Dimitry Andric  (from Sun, 12 Jul 2020  
15:36:25 +0200):



On 12 Jul 2020, at 11:51, Alexander Leidinger  wrote:


Author: netchild
Date: Sun Jul 12 09:51:09 2020
New Revision: 363125
URL: https://svnweb.freebsd.org/changeset/base/363125

Log:
 Implement CLOCK_MONOTONIC_RAW (linux >= 2.6.28).

 It is documented as a raw hardware-based clock not subject to NTP or
 incremental adjustments. With this "not as precise as CLOCK_MONOTONIC"
 description in mind, map it to our CLOCK_MONOTNIC_FAST (the same
 mapping as for the linux CLOCK_MONOTONIC_COARSE).


Okay, but:


@@ -212,6 +212,7 @@ linux_to_native_clockid(clockid_t *n, clockid_t l)
*n = CLOCK_THREAD_CPUTIME_ID;
break;
case LINUX_CLOCK_REALTIME_COARSE:
+   case LINUX_CLOCK_MONOTONIC_RAW:
*n = CLOCK_REALTIME_FAST;
break;
case LINUX_CLOCK_MONOTONIC_COARSE:


this shows it is actually mapped to CLOCK_REALTIME_FAST, not
CLOCK_MONOTONIC_FAST. Is the code right, or the commit message? :)


The commit message and the code I have running are right, the code I  
committed from a "no other change than that"-svn-tree was not. :(

I think I should switch to "diff | patch" even for one-liners like that.

I commited the fix based upon another message I've seen before this  
one, but thanks for looking at the code.


Bye,
Alexander.

--
http://www.Leidinger.net alexan...@leidinger.net: PGP 0x8F31830F9F2772BF
http://www.FreeBSD.orgnetch...@freebsd.org  : PGP 0x8F31830F9F2772BF


pgpWt6J1gVLa9.pgp
Description: Digitale PGP-Signatur


svn commit: r363130 - head/sys/compat/linux

2020-07-12 Thread Alexander Leidinger
Author: netchild
Date: Sun Jul 12 14:57:29 2020
New Revision: 363130
URL: https://svnweb.freebsd.org/changeset/base/363130

Log:
  Fix r363125 (Implement CLOCK_MONOTONIC_RAW (linux >= 2.6.28)),
  by realy using the MONOTONIC version and not the REALTIME version.
  
  Noticed by:   myfreeweb at github

Modified:
  head/sys/compat/linux/linux_time.c

Modified: head/sys/compat/linux/linux_time.c
==
--- head/sys/compat/linux/linux_time.c  Sun Jul 12 14:50:12 2020
(r363129)
+++ head/sys/compat/linux/linux_time.c  Sun Jul 12 14:57:29 2020
(r363130)
@@ -212,10 +212,10 @@ linux_to_native_clockid(clockid_t *n, clockid_t l)
*n = CLOCK_THREAD_CPUTIME_ID;
break;
case LINUX_CLOCK_REALTIME_COARSE:
-   case LINUX_CLOCK_MONOTONIC_RAW:
*n = CLOCK_REALTIME_FAST;
break;
case LINUX_CLOCK_MONOTONIC_COARSE:
+   case LINUX_CLOCK_MONOTONIC_RAW:
*n = CLOCK_MONOTONIC_FAST;
break;
case LINUX_CLOCK_BOOTTIME:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363129 - head/sys/netinet

2020-07-12 Thread Michael Tuexen
Author: tuexen
Date: Sun Jul 12 14:50:12 2020
New Revision: 363129
URL: https://svnweb.freebsd.org/changeset/base/363129

Log:
  (Re)activate SCTP system calls when compiling SCTP support into the kernel
  r363079 introduced the possibility of loading the SCTP stack as a module in
  addition to compiling it into the kernel. As part of this, the registration
  of the system calls was removed and put into the loading of the module.
  Therefore, the system calls are not registered anymore when compiling the
  SCTP into the kernel. This patch addresses that.
  
  Reviewed by:  markj
  Differential Revision:https://reviews.freebsd.org/D25632

Modified:
  head/sys/netinet/sctp_syscalls.c

Modified: head/sys/netinet/sctp_syscalls.c
==
--- head/sys/netinet/sctp_syscalls.cSun Jul 12 11:24:23 2020
(r363128)
+++ head/sys/netinet/sctp_syscalls.cSun Jul 12 14:50:12 2020
(r363129)
@@ -117,6 +117,10 @@ sctp_syscalls_init(void)
return (0);
 }
 
+#ifdef SCTP
+SYSINIT(sctp_syscalls, SI_SUB_SYSCALLS, SI_ORDER_ANY, sctp_syscalls_init, 
NULL);
+#endif
+
 int
 sctp_syscalls_uninit(void)
 {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


Re: svn commit: r363125 - head/sys/compat/linux

2020-07-12 Thread Dimitry Andric
On 12 Jul 2020, at 11:51, Alexander Leidinger  wrote:
> 
> Author: netchild
> Date: Sun Jul 12 09:51:09 2020
> New Revision: 363125
> URL: https://svnweb.freebsd.org/changeset/base/363125
> 
> Log:
>  Implement CLOCK_MONOTONIC_RAW (linux >= 2.6.28).
> 
>  It is documented as a raw hardware-based clock not subject to NTP or
>  incremental adjustments. With this "not as precise as CLOCK_MONOTONIC"
>  description in mind, map it to our CLOCK_MONOTNIC_FAST (the same
>  mapping as for the linux CLOCK_MONOTONIC_COARSE).

Okay, but:

> @@ -212,6 +212,7 @@ linux_to_native_clockid(clockid_t *n, clockid_t l)
>   *n = CLOCK_THREAD_CPUTIME_ID;
>   break;
>   case LINUX_CLOCK_REALTIME_COARSE:
> + case LINUX_CLOCK_MONOTONIC_RAW:
>   *n = CLOCK_REALTIME_FAST;
>   break;
>   case LINUX_CLOCK_MONOTONIC_COARSE:

this shows it is actually mapped to CLOCK_REALTIME_FAST, not
CLOCK_MONOTONIC_FAST. Is the code right, or the commit message? :)

-Dimitry



signature.asc
Description: Message signed with OpenPGP


svn commit: r363128 - in head/sys: net net/route netinet6

2020-07-12 Thread Alexander V. Chernikov
Author: melifaro
Date: Sun Jul 12 11:24:23 2020
New Revision: 363128
URL: https://svnweb.freebsd.org/changeset/base/363128

Log:
  Switch inet6 default route subscription to the new rib subscription api.
  
  Old subscription model allowed only single customer.
  
  Switch inet6 to the new subscription api and eliminate the old model.
  
  Differential Revision:https://reviews.freebsd.org/D25615

Modified:
  head/sys/net/if_var.h
  head/sys/net/route/route_ctl.c
  head/sys/netinet6/in6_rmx.c
  head/sys/netinet6/nd6.c
  head/sys/netinet6/nd6.h
  head/sys/netinet6/nd6_rtr.c

Modified: head/sys/net/if_var.h
==
--- head/sys/net/if_var.h   Sun Jul 12 11:18:09 2020(r363127)
+++ head/sys/net/if_var.h   Sun Jul 12 11:24:23 2020(r363128)
@@ -61,8 +61,6 @@
  */
 
 struct rtentry;/* ifa_rtrequest */
-struct nhop_object;/* ifa_rtrequest */
-struct rt_addrinfo;/* ifa_rtrequest */
 struct socket;
 struct carp_if;
 struct carp_softc;
@@ -551,9 +549,6 @@ struct ifaddr {
struct  ifnet *ifa_ifp; /* back-pointer to interface */
struct  carp_softc *ifa_carp;   /* pointer to CARP data */
CK_STAILQ_ENTRY(ifaddr) ifa_link;   /* queue macro glue */
-   void(*ifa_rtrequest)/* check or clean routes (+ or -)'d */
-   (int, struct rtentry *, struct nhop_object *,
-struct rt_addrinfo *);
u_short ifa_flags;  /* mostly rt_flags for cloning */
 #defineIFA_ROUTE   RTF_UP  /* route installed */
 #defineIFA_RTSELF  RTF_HOST/* loopback route to self 
installed */

Modified: head/sys/net/route/route_ctl.c
==
--- head/sys/net/route/route_ctl.c  Sun Jul 12 11:18:09 2020
(r363127)
+++ head/sys/net/route/route_ctl.c  Sun Jul 12 11:24:23 2020
(r363128)
@@ -79,7 +79,6 @@ struct rib_subscription {
 static void rib_notify(struct rib_head *rnh, enum rib_subscription_type type,
 struct rib_cmd_info *rc);
 
-static void rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info);
 static void destroy_subscription_epoch(epoch_context_t ctx);
 
 static struct rib_head *
@@ -275,10 +274,8 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in
if ((rn != NULL) || (rt_old != NULL))
rib_notify(rnh, RIB_NOTIFY_DELAYED, rc);
 
-   if (rt_old != NULL) {
-   rt_notifydelete(rt_old, info);
+   if (rt_old != NULL)
rtfree(rt_old);
-   }
 
/*
 * If it still failed to go into the tree,
@@ -290,13 +287,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in
return (EEXIST);
}
 
-   /*
-* If this protocol has something to add to this then
-* allow it to do that as well.
-*/
-   if (ifa->ifa_rtrequest)
-   ifa->ifa_rtrequest(RTM_ADD, rt, rt->rt_nhop, info);
-
RT_UNLOCK(rt);
 
return (0);
@@ -432,7 +422,6 @@ del_route(struct rib_head *rnh, struct rt_addrinfo *in
return (error);
 
rib_notify(rnh, RIB_NOTIFY_DELAYED, rc);
-   rt_notifydelete(rt, info);
 
/*
 * If the caller wants it, then it can have it,
@@ -554,15 +543,9 @@ change_route_one(struct rib_head *rnh, struct rt_addri
RT_LOCK(rt);
 
/* Provide notification to the protocols.*/
-   if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest)
-   nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info);
-
rt->rt_nhop = nh;
rt_setmetrics(info, rt);
 
-   if ((nh_orig->nh_ifa != nh->nh_ifa) && nh_orig->nh_ifa->ifa_rtrequest)
-   nh_orig->nh_ifa->ifa_rtrequest(RTM_DELETE, rt, nh_orig, info);
-
/* Finalize notification */
rc->rc_rt = rt;
rc->rc_nh_old = nh_orig;
@@ -641,19 +624,6 @@ rib_action(uint32_t fibnum, int action, struct rt_addr
 }
 
 
-static void
-rt_notifydelete(struct rtentry *rt, struct rt_addrinfo *info)
-{
-   struct ifaddr *ifa;
-
-   /*
-* give the protocol a chance to keep things in sync.
-*/
-   ifa = rt->rt_nhop->nh_ifa;
-   if (ifa != NULL && ifa->ifa_rtrequest != NULL)
-   ifa->ifa_rtrequest(RTM_DELETE, rt, rt->rt_nhop, info);
-}
-
 struct rt_delinfo
 {
struct rt_addrinfo info;
@@ -748,8 +718,6 @@ rib_walk_del(u_int fibnum, int family, rt_filter_f_t *
/* TODO std rt -> rt_addrinfo export */
di.info.rti_info[RTAX_DST] = rt_key(rt);
di.info.rti_info[RTAX_NETMASK] = rt_mask(rt);
-
-   rt_notifydelete(rt, );
 
if (report)
rt_routemsg(RTM_DELETE, rt, rt->rt_nhop->nh_ifp, 0,

Modified: head/sys/netinet6/in6_rmx.c

svn commit: r363127 - in head/sys/net: . route

2020-07-12 Thread Alexander V. Chernikov
Author: melifaro
Date: Sun Jul 12 11:18:09 2020
New Revision: 363127
URL: https://svnweb.freebsd.org/changeset/base/363127

Log:
  Add destructor for the rib subscription system to simplify users code.
  
  Subscriptions are planned to be used by modules such as route lookup engines.
  In that case that's the module task to properly unsibscribe before detach.
  However, the in-kernel customer - inet6 wants to track default route changes.
  To avoid having inet6 store per-fib subscriptions, handle automatic
   destruction internally.
  
  Differential Revision:https://reviews.freebsd.org/D25614

Modified:
  head/sys/net/route.c
  head/sys/net/route/route_ctl.c
  head/sys/net/route/shared.h

Modified: head/sys/net/route.c
==
--- head/sys/net/route.cSun Jul 12 10:07:01 2020(r363126)
+++ head/sys/net/route.cSun Jul 12 11:18:09 2020(r363127)
@@ -348,7 +348,7 @@ rt_table_init(int offset, int family, u_int fibnum)
nhops_init_rib(rh);
 
/* Init subscription system */
-   CK_STAILQ_INIT(>rnh_subscribers);
+   rib_init_subscriptions(rh);
 
/* Finally, set base callbacks */
rh->rnh_addaddr = rn_addroute;
@@ -382,6 +382,8 @@ rt_table_destroy(struct rib_head *rh)
rn_walktree(>rmhead.head, rt_freeentry, >rmhead.head);
 
nhops_destroy_rib(rh);
+
+   rib_destroy_subscriptions(rh);
 
/* Assume table is already empty */
RIB_LOCK_DESTROY(rh);

Modified: head/sys/net/route/route_ctl.c
==
--- head/sys/net/route/route_ctl.c  Sun Jul 12 10:07:01 2020
(r363126)
+++ head/sys/net/route/route_ctl.c  Sun Jul 12 11:18:09 2020
(r363127)
@@ -847,3 +847,28 @@ destroy_subscription_epoch(epoch_context_t ctx)
 
free(rs, M_RTABLE);
 }
+
+void
+rib_init_subscriptions(struct rib_head *rnh)
+{
+
+   CK_STAILQ_INIT(>rnh_subscribers);
+}
+
+void
+rib_destroy_subscriptions(struct rib_head *rnh)
+{
+   struct rib_subscription *rs;
+   struct epoch_tracker et;
+
+   NET_EPOCH_ENTER(et);
+   RIB_WLOCK(rnh);
+   while ((rs = CK_STAILQ_FIRST(>rnh_subscribers)) != NULL) {
+   CK_STAILQ_REMOVE_HEAD(>rnh_subscribers, next);
+   epoch_call(net_epoch_preempt, destroy_subscription_epoch,
+   >epoch_ctx);
+   }
+   RIB_WUNLOCK(rnh);
+   NET_EPOCH_EXIT(et);
+}
+

Modified: head/sys/net/route/shared.h
==
--- head/sys/net/route/shared.h Sun Jul 12 10:07:01 2020(r363126)
+++ head/sys/net/route/shared.h Sun Jul 12 11:18:09 2020(r363127)
@@ -67,6 +67,10 @@ int nhop_create_from_nhop(struct rib_head *rnh, const 
 void nhops_update_ifmtu(struct rib_head *rh, struct ifnet *ifp, uint32_t mtu);
 int nhops_dump_sysctl(struct rib_head *rh, struct sysctl_req *w);
 
+/* subscriptions */
+void rib_init_subscriptions(struct rib_head *rnh);
+void rib_destroy_subscriptions(struct rib_head *rnh);
+
 /* route */
 VNET_DECLARE(uma_zone_t, rtzone);  /* Routing table UMA zone. */
 #defineV_rtzoneVNET(rtzone)
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363126 - stable/12/usr.bin/pom

2020-07-12 Thread Thomas Munro
Author: tmunro
Date: Sun Jul 12 10:07:01 2020
New Revision: 363126
URL: https://svnweb.freebsd.org/changeset/base/363126

Log:
  MFC r340655
pom: Fix fencepost bugs.
  
  PR:   231705
  Submitted by:   Andrew Gierth 
  Approved by:  allanjude (mentor)

Modified:
  stable/12/usr.bin/pom/pom.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/pom/pom.c
==
--- stable/12/usr.bin/pom/pom.c Sun Jul 12 09:51:09 2020(r363125)
+++ stable/12/usr.bin/pom/pom.c Sun Jul 12 10:07:01 2020(r363126)
@@ -135,11 +135,13 @@ main(int argc, char **argv)
tmd.tm_hour = 0;
tmd.tm_min = 0;
tmd.tm_sec = 0;
+   tmd.tm_isdst = -1;
}
if (otime != NULL) {
tmd.tm_hour = strtol(otime, NULL, 10);
tmd.tm_min = strtol(otime + 3, NULL, 10);
tmd.tm_sec = strtol(otime + 6, NULL, 10);
+   tmd.tm_isdst = -1;
}
tt = mktime();
}
@@ -149,19 +151,19 @@ main(int argc, char **argv)
(GMT.tm_min / 60.0) + (GMT.tm_sec / 3600.0)) / 24.0);
for (cnt = EPOCH; cnt < GMT.tm_year; ++cnt)
days += isleap(1900 + cnt) ? 366 : 365;
-   today = potm(days) + .5;
+   today = potm(days);
if (pflag) {
(void)printf("%1.0f\n", today);
return (0);
}
(void)printf("The Moon is ");
-   if ((int)today == 100)
+   if (today >= 99.5)
(void)printf("Full\n");
-   else if (!(int)today)
+   else if (today < 0.5)
(void)printf("New\n");
else {
tomorrow = potm(days + 1);
-   if ((int)today == 50)
+   if (today >= 49.5 && today < 50.5)
(void)printf("%s\n", tomorrow > today ?
"at the First Quarter" : "at the Last Quarter");
else {
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363125 - head/sys/compat/linux

2020-07-12 Thread Alexander Leidinger
Author: netchild
Date: Sun Jul 12 09:51:09 2020
New Revision: 363125
URL: https://svnweb.freebsd.org/changeset/base/363125

Log:
  Implement CLOCK_MONOTONIC_RAW (linux >= 2.6.28).
  
  It is documented as a raw hardware-based clock not subject to NTP or
  incremental adjustments. With this "not as precise as CLOCK_MONOTONIC"
  description in mind, map it to our CLOCK_MONOTNIC_FAST (the same
  mapping as for the linux CLOCK_MONOTONIC_COARSE).
  
  This is needed for the webcomponent of steam (chromium) and some
  other steam component or game.
  
  The linux-steam-utils port contains a LD_PRELOAD based fix for this.
  There this is mapped to CLOCK_MONOTONIC.
  As an untrained ear/eye (= the majority of people) is normaly not
  noticing a difference of jitter in the 10-20 ms range, specially
  if you don't pay attention like for example in a browser session
  while watching a video stream, the mapping to CLOCK_MONOTONIC_FAST
  seems more appropriate than to CLOCK_MONOTONIC.

Modified:
  head/sys/compat/linux/linux_time.c

Modified: head/sys/compat/linux/linux_time.c
==
--- head/sys/compat/linux/linux_time.c  Sun Jul 12 09:49:53 2020
(r363124)
+++ head/sys/compat/linux/linux_time.c  Sun Jul 12 09:51:09 2020
(r363125)
@@ -212,6 +212,7 @@ linux_to_native_clockid(clockid_t *n, clockid_t l)
*n = CLOCK_THREAD_CPUTIME_ID;
break;
case LINUX_CLOCK_REALTIME_COARSE:
+   case LINUX_CLOCK_MONOTONIC_RAW:
*n = CLOCK_REALTIME_FAST;
break;
case LINUX_CLOCK_MONOTONIC_COARSE:
@@ -220,7 +221,6 @@ linux_to_native_clockid(clockid_t *n, clockid_t l)
case LINUX_CLOCK_BOOTTIME:
*n = CLOCK_UPTIME;
break;
-   case LINUX_CLOCK_MONOTONIC_RAW:
case LINUX_CLOCK_REALTIME_ALARM:
case LINUX_CLOCK_BOOTTIME_ALARM:
case LINUX_CLOCK_SGI_CYCLE:
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363124 - stable/12/usr.bin/truss

2020-07-12 Thread Thomas Munro
Author: tmunro
Date: Sun Jul 12 09:49:53 2020
New Revision: 363124
URL: https://svnweb.freebsd.org/changeset/base/363124

Log:
  MFC r344656
truss: Add support for fsync(2) and fdatasync(2).
  
  Approved by:mjg (mentor)
  Differential Revision:  https://reviews.freebsd.org/D19295

Modified:
  stable/12/usr.bin/truss/syscalls.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.bin/truss/syscalls.c
==
--- stable/12/usr.bin/truss/syscalls.c  Sun Jul 12 07:59:15 2020
(r363123)
+++ stable/12/usr.bin/truss/syscalls.c  Sun Jul 12 09:49:53 2020
(r363124)
@@ -233,6 +233,8 @@ static struct syscall decoded_syscalls[] = {
{ Atflags, 4 } } },
{ .name = "fcntl", .ret_type = 1, .nargs = 3,
  .args = { { Int, 0 }, { Fcntl, 1 }, { Fcntlflag, 2 } } },
+   { .name = "fdatasync", .ret_type = 1, .nargs = 1,
+ .args = { { Int, 0 } } },
{ .name = "flock", .ret_type = 1, .nargs = 2,
  .args = { { Int, 0 }, { Flockop, 1 } } },
{ .name = "fstat", .ret_type = 1, .nargs = 2,
@@ -242,6 +244,8 @@ static struct syscall decoded_syscalls[] = {
{ Atflags, 3 } } },
{ .name = "fstatfs", .ret_type = 1, .nargs = 2,
  .args = { { Int, 0 }, { StatFs | OUT, 1 } } },
+   { .name = "fsync", .ret_type = 1, .nargs = 1,
+ .args = { { Int, 0 } } },
{ .name = "ftruncate", .ret_type = 1, .nargs = 2,
  .args = { { Int | IN, 0 }, { QuadHex | IN, 1 } } },
{ .name = "futimens", .ret_type = 1, .nargs = 2,
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363123 - head/sys/dev/extres/clk

2020-07-12 Thread Michal Meloun
Author: mmel
Date: Sun Jul 12 07:59:15 2020
New Revision: 363123
URL: https://svnweb.freebsd.org/changeset/base/363123

Log:
  Reverse the processing order of assigned clocks property.
  Linux processes these clocks in reverse order and some DT relies
  on this fact. For example, the frequency setting for a given PLL
  is the last in the list, preceded by the frequency setting of its
  following divider or so...
  
  MFC after:1 week

Modified:
  head/sys/dev/extres/clk/clk.c

Modified: head/sys/dev/extres/clk/clk.c
==
--- head/sys/dev/extres/clk/clk.c   Sun Jul 12 07:42:21 2020
(r363122)
+++ head/sys/dev/extres/clk/clk.c   Sun Jul 12 07:59:15 2020
(r363123)
@@ -1407,7 +1407,7 @@ clk_set_assigned(device_t dev, phandle_t node)
if (ofw_bus_parse_xref_list_get_length(node,
"assigned-clock-parents", "#clock-cells", ) != 0)
nparents = -1;
-   for (i = 0; i < nclocks; i++) {
+   for (i = nclocks - 1; i >= 0; i--) {
/* First get the clock we are supposed to modify */
rv = clk_get_by_ofw_index_prop(dev, 0, "assigned-clocks",
i, );
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363122 - head/sys/dev/extres/clk

2020-07-12 Thread Michal Meloun
Author: mmel
Date: Sun Jul 12 07:42:21 2020
New Revision: 363122
URL: https://svnweb.freebsd.org/changeset/base/363122

Log:
   Assigned clocks: fix off-by-one bug, don't leak allocated memory.
  
   MFC after:   1 week

Modified:
  head/sys/dev/extres/clk/clk.c

Modified: head/sys/dev/extres/clk/clk.c
==
--- head/sys/dev/extres/clk/clk.c   Sun Jul 12 07:27:21 2020
(r363121)
+++ head/sys/dev/extres/clk/clk.c   Sun Jul 12 07:42:21 2020
(r363122)
@@ -1420,15 +1420,17 @@ clk_set_assigned(device_t dev, phandle_t node)
}
 
/* First set it's parent if needed */
-   if (i <= nparents)
+   if (i < nparents)
clk_set_assigned_parent(dev, clk, i);
 
/* Then set a new frequency */
-   if (i <= nrates && rates[i] != 0)
+   if (i < nrates && rates[i] != 0)
clk_set_assigned_rates(dev, clk, rates[i]);
 
clk_release(clk);
}
+   if (rates != NULL)
+   OF_prop_free(rates);
 
return (0);
 }
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363121 - in head/sys/arm: broadcom/bcm2835 mv

2020-07-12 Thread Michal Meloun
Author: mmel
Date: Sun Jul 12 07:27:21 2020
New Revision: 363121
URL: https://svnweb.freebsd.org/changeset/base/363121

Log:
  Fix the module name for some arm drivers.
  Module name (unlike of the of driver name) must be system wide unique.
  
  Reported by:  Mark Millard(bcm_pci), andrew(mvebu_gpio)
  MFC with: r362954, r362385

Modified:
  head/sys/arm/broadcom/bcm2835/bcm2838_pci.c
  head/sys/arm/mv/mvebu_gpio.c

Modified: head/sys/arm/broadcom/bcm2835/bcm2838_pci.c
==
--- head/sys/arm/broadcom/bcm2835/bcm2838_pci.c Sun Jul 12 07:25:02 2020
(r363120)
+++ head/sys/arm/broadcom/bcm2835/bcm2838_pci.c Sun Jul 12 07:27:21 2020
(r363121)
@@ -739,5 +739,5 @@ DEFINE_CLASS_1(pcib, bcm_pcib_driver, bcm_pcib_methods
 sizeof(struct bcm_pcib_softc), generic_pcie_fdt_driver);
 
 static devclass_t bcm_pcib_devclass;
-DRIVER_MODULE(pcib, simplebus, bcm_pcib_driver, bcm_pcib_devclass, 0, 0);
+DRIVER_MODULE(bcm_pcib, simplebus, bcm_pcib_driver, bcm_pcib_devclass, 0, 0);
 

Modified: head/sys/arm/mv/mvebu_gpio.c
==
--- head/sys/arm/mv/mvebu_gpio.cSun Jul 12 07:25:02 2020
(r363120)
+++ head/sys/arm/mv/mvebu_gpio.cSun Jul 12 07:27:21 2020
(r363121)
@@ -864,6 +864,6 @@ static device_method_t mvebu_gpio_methods[] = {
 static devclass_t mvebu_gpio_devclass;
 static DEFINE_CLASS_0(gpio, mvebu_gpio_driver, mvebu_gpio_methods,
 sizeof(struct mvebu_gpio_softc));
-EARLY_DRIVER_MODULE(gpio, simplebus, mvebu_gpio_driver,
+EARLY_DRIVER_MODULE(mvebu_gpio, simplebus, mvebu_gpio_driver,
  mvebu_gpio_devclass, NULL, NULL,
  BUS_PASS_TIMER + BUS_PASS_ORDER_LAST);
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363120 - in stable: 11/sbin/shutdown 12/sbin/shutdown

2020-07-12 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Sun Jul 12 07:25:02 2020
New Revision: 363120
URL: https://svnweb.freebsd.org/changeset/base/363120

Log:
  MFC r362942: shutdown.8: Fix typo
  
  Fix a typo in shutdown.8, use ',' instead of '.' when listing items.

Modified:
  stable/11/sbin/shutdown/shutdown.8
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/12/sbin/shutdown/shutdown.8
Directory Properties:
  stable/12/   (props changed)

Modified: stable/11/sbin/shutdown/shutdown.8
==
--- stable/11/sbin/shutdown/shutdown.8  Sun Jul 12 04:29:39 2020
(r363119)
+++ stable/11/sbin/shutdown/shutdown.8  Sun Jul 12 07:25:02 2020
(r363120)
@@ -124,7 +124,7 @@ suffix:
 .Dq Li s ,
 .Dq Li sec ,
 .Dq Li m ,
-.Dq Li min .
+.Dq Li min ,
 .Dq Li h ,
 .Dq Li hour .
 .It Ar warning-message
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r363120 - in stable: 11/sbin/shutdown 12/sbin/shutdown

2020-07-12 Thread Niclas Zeising
Author: zeising (doc,ports committer)
Date: Sun Jul 12 07:25:02 2020
New Revision: 363120
URL: https://svnweb.freebsd.org/changeset/base/363120

Log:
  MFC r362942: shutdown.8: Fix typo
  
  Fix a typo in shutdown.8, use ',' instead of '.' when listing items.

Modified:
  stable/12/sbin/shutdown/shutdown.8
Directory Properties:
  stable/12/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/11/sbin/shutdown/shutdown.8
Directory Properties:
  stable/11/   (props changed)

Modified: stable/12/sbin/shutdown/shutdown.8
==
--- stable/12/sbin/shutdown/shutdown.8  Sun Jul 12 04:29:39 2020
(r363119)
+++ stable/12/sbin/shutdown/shutdown.8  Sun Jul 12 07:25:02 2020
(r363120)
@@ -135,7 +135,7 @@ suffix:
 .Dq Li s ,
 .Dq Li sec ,
 .Dq Li m ,
-.Dq Li min .
+.Dq Li min ,
 .Dq Li h ,
 .Dq Li hour .
 .Pp
___
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"