svn commit: r367319 - stable/11/sbin/ifconfig

2020-11-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Wed Nov  4 07:54:07 2020
New Revision: 367319
URL: https://svnweb.freebsd.org/changeset/base/367319

Log:
  MFC r367258:
  
  Remove Tn macros from ifconfig.8

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

Modified: stable/11/sbin/ifconfig/ifconfig.8
==
--- stable/11/sbin/ifconfig/ifconfig.8  Wed Nov  4 07:53:24 2020
(r367318)
+++ stable/11/sbin/ifconfig/ifconfig.8  Wed Nov  4 07:54:07 2020
(r367319)
@@ -92,15 +92,11 @@ or other operating parameters.
 The following options are available:
 .Bl -tag -width indent
 .It Ar address
-For the
-.Tn DARPA Ns -Internet
-family,
+For the DARPA-Internet family,
 the address is either a host name present in the host name data
 base,
 .Xr hosts 5 ,
-or a
-.Tn DARPA
-Internet address expressed in the Internet standard
+or a DARPA Internet address expressed in the Internet standard
 .Dq dot notation .
 .Pp
 It is also possible to use the CIDR notation (also known as the
@@ -131,9 +127,7 @@ parameter below for more information.
 .\" (Ethernet, FDDI, and Token Ring) interfaces,
 .\" which use the hardware physical address,
 .\" and on interfaces other than the first.
-.\" For the
-.\" .Tn ISO
-.\" family, addresses are specified as a long hexadecimal string,
+.\" For the ISO family, addresses are specified as a long hexadecimal string,
 .\" as in the Xerox family.
 .\" However, two consecutive dots imply a zero
 .\" byte, and the dots are optional, if the user wishes to (carefully)
@@ -320,12 +314,8 @@ Enable the use of the Address Resolution Protocol
 .Pq Xr arp 4
 in mapping
 between network level addresses and link level addresses (default).
-This is currently implemented for mapping between
-.Tn DARPA
-Internet
-addresses and
-.Tn IEEE
-802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
+This is currently implemented for mapping between DARPA Internet addresses
+and IEEE 802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
 .It Fl arp
 Disable the use of the Address Resolution Protocol
 .Pq Xr arp 4 .
@@ -425,8 +415,7 @@ of the interface to
 Some interfaces support the mutually exclusive use of one of several
 different physical media connectors.
 For example, a 10Mbit/s Ethernet
-interface might support the use of either
-.Tn AUI
+interface might support the use of either AUI
 or twisted pair connectors.
 Setting the media type to
 .Cm 10base5/AUI
@@ -562,7 +551,7 @@ Note that this must be issued on a physical interface 
 not on a
 .Xr vlan 4
 interface itself.
-.It Fl vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso
+.It Fl vlanmtu , vlanhwtag , vlanhwfilter , vlanhwtso
 If the driver offers user-configurable VLAN support, disable
 reception of extended frames, tag processing in hardware,
 frame filtering in hardware, or TSO on VLAN,
@@ -603,16 +592,12 @@ Destroy the specified network pseudo-device.
 Another name for the
 .Cm create
 parameter.
-Included for
-.Tn Solaris
-compatibility.
+Included for Solaris compatibility.
 .It Cm unplumb
 Another name for the
 .Cm destroy
 parameter.
-Included for
-.Tn Solaris
-compatibility.
+Included for Solaris compatibility.
 .It Cm metric Ar n
 Set the routing metric of the interface to
 .Ar n ,
@@ -1930,9 +1915,7 @@ string or as a string of hexadecimal digits preceded b
 .Ql 0x .
 For maximum portability, hex keys are recommended;
 the mapping of text keys to WEP encryption is usually driver-specific.
-In particular, the
-.Tn Windows
-drivers do this mapping differently to
+In particular, the Windows drivers do this mapping differently to
 .Fx .
 A key may be cleared by setting it to
 .Ql - .
___
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: r367318 - stable/12/sbin/ifconfig

2020-11-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Wed Nov  4 07:53:24 2020
New Revision: 367318
URL: https://svnweb.freebsd.org/changeset/base/367318

Log:
  MFC r367258:
  
  Remove Tn macros from ifconfig.8

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

Modified: stable/12/sbin/ifconfig/ifconfig.8
==
--- stable/12/sbin/ifconfig/ifconfig.8  Wed Nov  4 07:52:42 2020
(r367317)
+++ stable/12/sbin/ifconfig/ifconfig.8  Wed Nov  4 07:53:24 2020
(r367318)
@@ -92,15 +92,11 @@ or other operating parameters.
 The following options are available:
 .Bl -tag -width indent
 .It Ar address
-For the
-.Tn DARPA Ns -Internet
-family,
+For the DARPA-Internet family,
 the address is either a host name present in the host name data
 base,
 .Xr hosts 5 ,
-or a
-.Tn DARPA
-Internet address expressed in the Internet standard
+or a DARPA Internet address expressed in the Internet standard
 .Dq dot notation .
 .Pp
 It is also possible to use the CIDR notation (also known as the
@@ -131,9 +127,7 @@ parameter below for more information.
 .\" (Ethernet, FDDI, and Token Ring) interfaces,
 .\" which use the hardware physical address,
 .\" and on interfaces other than the first.
-.\" For the
-.\" .Tn ISO
-.\" family, addresses are specified as a long hexadecimal string,
+.\" For the ISO family, addresses are specified as a long hexadecimal string,
 .\" as in the Xerox family.
 .\" However, two consecutive dots imply a zero
 .\" byte, and the dots are optional, if the user wishes to (carefully)
@@ -320,12 +314,8 @@ Enable the use of the Address Resolution Protocol
 .Pq Xr arp 4
 in mapping
 between network level addresses and link level addresses (default).
-This is currently implemented for mapping between
-.Tn DARPA
-Internet
-addresses and
-.Tn IEEE
-802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
+This is currently implemented for mapping between DARPA Internet addresses
+and IEEE 802 48-bit MAC addresses (Ethernet, FDDI, and Token Ring addresses).
 .It Fl arp
 Disable the use of the Address Resolution Protocol
 .Pq Xr arp 4 .
@@ -425,8 +415,7 @@ of the interface to
 Some interfaces support the mutually exclusive use of one of several
 different physical media connectors.
 For example, a 10Mbit/s Ethernet
-interface might support the use of either
-.Tn AUI
+interface might support the use of either AUI
 or twisted pair connectors.
 Setting the media type to
 .Cm 10base5/AUI
@@ -564,7 +553,7 @@ Note that this must be configured on a physical interf
 not on a
 .Xr vlan 4
 interface itself.
-.It Fl vlanmtu , vlanhwtag, vlanhwfilter, vlanhwtso
+.It Fl vlanmtu , vlanhwtag , vlanhwfilter , vlanhwtso
 If the driver offers user-configurable VLAN support, disable
 reception of extended frames, tag processing in hardware,
 frame filtering in hardware, or TSO on VLAN,
@@ -620,16 +609,12 @@ Destroy the specified network pseudo-device.
 Another name for the
 .Cm create
 parameter.
-Included for
-.Tn Solaris
-compatibility.
+Included for Solaris compatibility.
 .It Cm unplumb
 Another name for the
 .Cm destroy
 parameter.
-Included for
-.Tn Solaris
-compatibility.
+Included for Solaris compatibility.
 .It Cm metric Ar n
 Set the routing metric of the interface to
 .Ar n ,
@@ -1942,9 +1927,7 @@ string or as a string of hexadecimal digits preceded b
 .Ql 0x .
 For maximum portability, hex keys are recommended;
 the mapping of text keys to WEP encryption is usually driver-specific.
-In particular, the
-.Tn Windows
-drivers do this mapping differently to
+In particular, the Windows drivers do this mapping differently to
 .Fx .
 A key may be cleared by setting it to
 .Ql - .
___
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: r367316 - stable/12/sbin/ifconfig

2020-11-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Wed Nov  4 07:51:59 2020
New Revision: 367316
URL: https://svnweb.freebsd.org/changeset/base/367316

Log:
  MFC r367259:
  
  ifconfig.8: Improve formatting of -f in synopsis

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

Modified: stable/12/sbin/ifconfig/ifconfig.8
==
--- stable/12/sbin/ifconfig/ifconfig.8  Tue Nov  3 23:30:11 2020
(r367315)
+++ stable/12/sbin/ifconfig/ifconfig.8  Wed Nov  4 07:51:59 2020
(r367316)
@@ -28,7 +28,7 @@
 .\" From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd October 25, 2020
+.Dd November 1, 2020
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Nd configure network interface parameters
 .Sh SYNOPSIS
 .Nm
-.Op Fl f Ar type:format Ns Op Ar ,type:format
+.Op Fl f Ar type Ns Cm \&: Ns Ar format Ns Op Cm \&, Ns Ar type Ns Cm \& : Ns 
Ar format ...
 .Op Fl L
 .Op Fl k
 .Op Fl m
___
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: r367317 - stable/11/sbin/ifconfig

2020-11-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Wed Nov  4 07:52:42 2020
New Revision: 367317
URL: https://svnweb.freebsd.org/changeset/base/367317

Log:
  MFC r367259:
  
  ifconfig.8: Improve formatting of -f in synopsis

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

Modified: stable/11/sbin/ifconfig/ifconfig.8
==
--- stable/11/sbin/ifconfig/ifconfig.8  Wed Nov  4 07:51:59 2020
(r367316)
+++ stable/11/sbin/ifconfig/ifconfig.8  Wed Nov  4 07:52:42 2020
(r367317)
@@ -28,7 +28,7 @@
 .\" From: @(#)ifconfig.8   8.3 (Berkeley) 1/5/94
 .\" $FreeBSD$
 .\"
-.Dd October 25, 2020
+.Dd November 1, 2020
 .Dt IFCONFIG 8
 .Os
 .Sh NAME
@@ -36,7 +36,7 @@
 .Nd configure network interface parameters
 .Sh SYNOPSIS
 .Nm
-.Op Fl f Ar type:format Ns Op Ar ,type:format
+.Op Fl f Ar type Ns Cm \&: Ns Ar format Ns Op Cm \&, Ns Ar type Ns Cm \& : Ns 
Ar format ...
 .Op Fl L
 .Op Fl k
 .Op Fl m
___
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: r367315 - stable/11/lib/libc/tests/ssp

2020-11-03 Thread Brooks Davis
Author: brooks
Date: Tue Nov  3 23:30:11 2020
New Revision: 367315
URL: https://svnweb.freebsd.org/changeset/base/367315

Log:
  MFC r367121:
  
  Disable ssp raw test without ASAN
  
  r366981 disabled ASAN when it might not be reliable (with an external
  compiler), but this test is broken without ASAN so disable it completely
  in that case.
  
  PR:   250706
  Reviewed by:  emaste, lwhsu
  Differential Revision:https://reviews.freebsd.org/D26982

Modified:
  stable/11/lib/libc/tests/ssp/Makefile
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libc/tests/ssp/Makefile
==
--- stable/11/lib/libc/tests/ssp/Makefile   Tue Nov  3 23:29:07 2020
(r367314)
+++ stable/11/lib/libc/tests/ssp/Makefile   Tue Nov  3 23:30:11 2020
(r367315)
@@ -33,7 +33,7 @@ PROGS+=   h_memset
 # probably needs to be fixed as it's currently hardcoded.
 #
 # sanitizer is not tested or supported for ARM right now. sbruno
-.if ${COMPILER_TYPE} == "clang" && !defined(_SKIP_BUILD) && \
+.if ${COMPILER_TYPE} == "clang" && ${CC} == "cc" && !defined(_SKIP_BUILD) && \
 (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw")
 .if !defined(_CLANG_RESOURCE_DIR)
 _CLANG_RESOURCE_DIR!=  ${CC:N${CCACHE_BIN}} -print-resource-dir
___
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: r367314 - stable/12/lib/libc/tests/ssp

2020-11-03 Thread Brooks Davis
Author: brooks
Date: Tue Nov  3 23:29:07 2020
New Revision: 367314
URL: https://svnweb.freebsd.org/changeset/base/367314

Log:
  MFC r367121:
  
  Disable ssp raw test without ASAN
  
  r366981 disabled ASAN when it might not be reliable (with an external
  compiler), but this test is broken without ASAN so disable it completely
  in that case.
  
  PR:   250706
  Reviewed by:  emaste, lwhsu
  Differential Revision:https://reviews.freebsd.org/D26982

Modified:
  stable/12/lib/libc/tests/ssp/Makefile
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libc/tests/ssp/Makefile
==
--- stable/12/lib/libc/tests/ssp/Makefile   Tue Nov  3 23:27:24 2020
(r367313)
+++ stable/12/lib/libc/tests/ssp/Makefile   Tue Nov  3 23:29:07 2020
(r367314)
@@ -33,7 +33,7 @@ PROGS+=   h_memset
 # probably needs to be fixed as it's currently hardcoded.
 #
 # sanitizer is not tested or supported for ARM right now. sbruno
-.if ${COMPILER_TYPE} == "clang" && !defined(_SKIP_BUILD) && \
+.if ${COMPILER_TYPE} == "clang" && ${CC} == "cc" && !defined(_SKIP_BUILD) && \
 (!defined(_RECURSING_PROGS) || ${PROG} == "h_raw")
 .if !defined(_CLANG_RESOURCE_DIR)
 _CLANG_RESOURCE_DIR!=  ${CC:N${CCACHE_BIN}} -print-resource-dir
___
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: r367313 - stable/11/contrib/sendmail/include/sm/os

2020-11-03 Thread Brooks Davis
Author: brooks
Date: Tue Nov  3 23:27:24 2020
New Revision: 367313
URL: https://svnweb.freebsd.org/changeset/base/367313

Log:
  MFC r367063:
  
  Key decleration of union semun on src version
  
  __FreeBSD__ is defined by the compiler derived from the triple.  When
  building FreeBSD 11 on a FreeBSD 12 with a CROSS_TOOLCHAIN=llvm10,
  __FreeBSD__ was set to 12 when building lib32 (for some reason no triple
  is being passed which seems to mean that we're taking default values
  from the build system).  This in turn meant we end up with a double
  decleration of union semun which is a build error.
  
  Reviewed by:  gshapiro, dim
  Differential Revision:https://reviews.freebsd.org/D26902

Modified:
  stable/11/contrib/sendmail/include/sm/os/sm_os_freebsd.h
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/contrib/sendmail/include/sm/os/sm_os_freebsd.h
==
--- stable/11/contrib/sendmail/include/sm/os/sm_os_freebsd.hTue Nov  3 
23:26:26 2020(r367312)
+++ stable/11/contrib/sendmail/include/sm/os/sm_os_freebsd.hTue Nov  3 
23:27:24 2020(r367313)
@@ -32,8 +32,8 @@
 # define SM_CONF_SHM   1
 #endif
 #ifndef SM_CONF_SEM
-# if __FreeBSD__ > 11
-#  define SM_CONF_SEM  2 /* union semun is now longer available by default */
+# if __FreeBSD_version >= 1200059
+#  define SM_CONF_SEM  2 /* union semun is no longer declared by default */
 # else
 #  define SM_CONF_SEM  1
 # 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"


svn commit: r367312 - stable/12/contrib/sendmail/include/sm/os

2020-11-03 Thread Brooks Davis
Author: brooks
Date: Tue Nov  3 23:26:26 2020
New Revision: 367312
URL: https://svnweb.freebsd.org/changeset/base/367312

Log:
  MFC r367063:
  
  Key decleration of union semun on src version
  
  __FreeBSD__ is defined by the compiler derived from the triple.  When
  building FreeBSD 11 on a FreeBSD 12 with a CROSS_TOOLCHAIN=llvm10,
  __FreeBSD__ was set to 12 when building lib32 (for some reason no triple
  is being passed which seems to mean that we're taking default values
  from the build system).  This in turn meant we end up with a double
  decleration of union semun which is a build error.
  
  Reviewed by:  gshapiro, dim
  Differential Revision:https://reviews.freebsd.org/D26902

Modified:
  stable/12/contrib/sendmail/include/sm/os/sm_os_freebsd.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/contrib/sendmail/include/sm/os/sm_os_freebsd.h
==
--- stable/12/contrib/sendmail/include/sm/os/sm_os_freebsd.hTue Nov  3 
22:53:23 2020(r367311)
+++ stable/12/contrib/sendmail/include/sm/os/sm_os_freebsd.hTue Nov  3 
23:26:26 2020(r367312)
@@ -32,8 +32,8 @@
 # define SM_CONF_SHM   1
 #endif
 #ifndef SM_CONF_SEM
-# if __FreeBSD__ > 11
-#  define SM_CONF_SEM  2 /* union semun is now longer available by default */
+# if __FreeBSD_version >= 1200059
+#  define SM_CONF_SEM  2 /* union semun is no longer declared by default */
 # else
 #  define SM_CONF_SEM  1
 # 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"


svn commit: r367311 - head/tools/tools/crypto

2020-11-03 Thread John Baldwin
Author: jhb
Date: Tue Nov  3 22:53:23 2020
New Revision: 367311
URL: https://svnweb.freebsd.org/changeset/base/367311

Log:
  Remove unnecessary __DECONST().
  
  Reviewed by:  markj
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D27063

Modified:
  head/tools/tools/crypto/cryptocheck.c

Modified: head/tools/tools/crypto/cryptocheck.c
==
--- head/tools/tools/crypto/cryptocheck.c   Tue Nov  3 22:32:30 2020
(r367310)
+++ head/tools/tools/crypto/cryptocheck.c   Tue Nov  3 22:53:23 2020
(r367311)
@@ -492,7 +492,7 @@ ocf_hash(const struct alg *alg, const char *buffer, si
ocf_init_cop(&ses, &cop);
cop.op = 0;
cop.len = size;
-   cop.src = __DECONST(char *, buffer);
+   cop.src = buffer;
cop.mac = digest;
 
if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) {
@@ -596,7 +596,7 @@ ocf_hmac(const struct alg *alg, const char *buffer, si
 
ocf_init_sop(&sop);
sop.mackeylen = key_len;
-   sop.mackey = __DECONST(char *, key);
+   sop.mackey = key;
sop.mac = alg->mac;
if (!ocf_init_session(&sop, "HMAC", alg->name, &ses))
return (false);
@@ -604,7 +604,7 @@ ocf_hmac(const struct alg *alg, const char *buffer, si
ocf_init_cop(&ses, &cop);
cop.op = 0;
cop.len = size;
-   cop.src = __DECONST(char *, buffer);
+   cop.src = buffer;
cop.mac = digest;
 
if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) {
@@ -709,7 +709,7 @@ ocf_init_cipher_session(const struct alg *alg, const c
 
ocf_init_sop(&sop);
sop.keylen = key_len;
-   sop.key = __DECONST(char *, key);
+   sop.key = key;
sop.cipher = alg->cipher;
return (ocf_init_session(&sop, "cipher", alg->name, ses));
 }
@@ -723,9 +723,9 @@ ocf_cipher(const struct ocf_session *ses, const struct
ocf_init_cop(ses, &cop);
cop.op = op;
cop.len = size;
-   cop.src = __DECONST(char *, input);
+   cop.src = input;
cop.dst = output;
-   cop.iv = __DECONST(char *, iv);
+   cop.iv = iv;
 
if (ioctl(ses->fd, CIOCCRYPT, &cop) < 0) {
warn("cryptodev %s (%zu) cipher failed for device %s",
@@ -841,10 +841,10 @@ ocf_init_eta_session(const struct alg *alg, const char
 
ocf_init_sop(&sop);
sop.keylen = cipher_key_len;
-   sop.key = __DECONST(char *, cipher_key);
+   sop.key = cipher_key;
sop.cipher = alg->cipher;
sop.mackeylen = auth_key_len;
-   sop.mackey = __DECONST(char *, auth_key);
+   sop.mackey = auth_key;
sop.mac = alg->mac;
return (ocf_init_session(&sop, "ETA", alg->name, ses));
 }
@@ -864,11 +864,11 @@ ocf_eta(const struct ocf_session *ses, const char *iv,
caead.len = size;
caead.aadlen = aad_len;
caead.ivlen = iv_len;
-   caead.src = __DECONST(char *, input);
+   caead.src = input;
caead.dst = output;
-   caead.aad = __DECONST(char *, aad);
+   caead.aad = aad;
caead.tag = digest;
-   caead.iv = __DECONST(char *, iv);
+   caead.iv = iv;
 
ret = ioctl(ses->fd, CIOCCRYPTAEAD, &caead);
} else {
@@ -877,10 +877,10 @@ ocf_eta(const struct ocf_session *ses, const char *iv,
ocf_init_cop(ses, &cop);
cop.op = op;
cop.len = size;
-   cop.src = __DECONST(char *, input);
+   cop.src = input;
cop.dst = output;
cop.mac = digest;
-   cop.iv = __DECONST(char *, iv);
+   cop.iv = iv;
 
ret = ioctl(ses->fd, CIOCCRYPT, &cop);
}
@@ -1078,7 +1078,7 @@ ocf_gmac(const struct alg *alg, const char *input, siz
 
ocf_init_sop(&sop);
sop.mackeylen = key_len;
-   sop.mackey = __DECONST(char *, key);
+   sop.mackey = key;
sop.mac = alg->mac;
if (!ocf_init_session(&sop, "GMAC", alg->name, &ses))
return (false);
@@ -1086,7 +1086,7 @@ ocf_gmac(const struct alg *alg, const char *input, siz
ocf_init_cop(&ses, &cop);
cop.op = 0;
cop.len = size;
-   cop.src = __DECONST(char *, input);
+   cop.src = input;
cop.mac = tag;
cop.iv = iv;
 
@@ -1298,7 +1298,7 @@ ocf_init_aead_session(const struct alg *alg, const cha
 
ocf_init_sop(&sop);
sop.keylen = key_len;
-   sop.key = __DECONST(char *, key);
+   sop.key = key;
sop.cipher = alg->cipher;
return (ocf_init_session(&sop, "AEAD", alg->name, ses));
 }
@@ -1315,11 +1315,11 @@ ocf_aead(const struct ocf_session *ses, const char *iv
caead.len = size;
caead.aadlen = aad_len;
caead.ivlen = iv_len;
-   caead.src = __DECONST(char *, input);
+   caead.

svn commit: r367310 - in head/sys: crypto opencrypto

2020-11-03 Thread John Baldwin
Author: jhb
Date: Tue Nov  3 22:32:30 2020
New Revision: 367310
URL: https://svnweb.freebsd.org/changeset/base/367310

Log:
  Replace some K&R function definitions with ANSI C.
  
  Reviewed by:  markj
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D27062

Modified:
  head/sys/crypto/sha1.c
  head/sys/opencrypto/cryptodeflate.c
  head/sys/opencrypto/xform_deflate.c

Modified: head/sys/crypto/sha1.c
==
--- head/sys/crypto/sha1.c  Tue Nov  3 22:27:54 2020(r367309)
+++ head/sys/crypto/sha1.c  Tue Nov  3 22:32:30 2020(r367310)
@@ -91,8 +91,7 @@ static uint32_t _K[] = { 0x5a827999, 0x6ed9eba1, 0x8f1
 static void sha1_step(struct sha1_ctxt *);
 
 static void
-sha1_step(ctxt)
-   struct sha1_ctxt *ctxt;
+sha1_step(struct sha1_ctxt *ctxt)
 {
uint32_ta, b, c, d, e;
size_t t, s;
@@ -176,8 +175,7 @@ sha1_step(ctxt)
 /**/
 
 void
-sha1_init(ctxt)
-   struct sha1_ctxt *ctxt;
+sha1_init(struct sha1_ctxt *ctxt)
 {
bzero(ctxt, sizeof(struct sha1_ctxt));
H(0) = 0x67452301;
@@ -188,8 +186,7 @@ sha1_init(ctxt)
 }
 
 void
-sha1_pad(ctxt)
-   struct sha1_ctxt *ctxt;
+sha1_pad(struct sha1_ctxt *ctxt)
 {
size_t padlen;  /*pad length in bytes*/
size_t padstart;
@@ -223,10 +220,7 @@ sha1_pad(ctxt)
 }
 
 void
-sha1_loop(ctxt, input, len)
-   struct sha1_ctxt *ctxt;
-   const uint8_t *input;
-   size_t len;
+sha1_loop(struct sha1_ctxt *ctxt, const uint8_t *input, size_t len)
 {
size_t gaplen;
size_t gapstart;

Modified: head/sys/opencrypto/cryptodeflate.c
==
--- head/sys/opencrypto/cryptodeflate.c Tue Nov  3 22:27:54 2020
(r367309)
+++ head/sys/opencrypto/cryptodeflate.c Tue Nov  3 22:32:30 2020
(r367310)
@@ -82,11 +82,7 @@ crypto_zfree(void *nil, void *ptr)
  */
 
 uint32_t
-deflate_global(data, size, decomp, out)
-   uint8_t *data;
-   uint32_t size;
-   int decomp;
-   uint8_t **out;
+deflate_global(uint8_t *data, uint32_t size, int decomp, uint8_t **out)
 {
/* decomp indicates whether we compress (0) or decompress (1) */
 

Modified: head/sys/opencrypto/xform_deflate.c
==
--- head/sys/opencrypto/xform_deflate.c Tue Nov  3 22:27:54 2020
(r367309)
+++ head/sys/opencrypto/xform_deflate.c Tue Nov  3 22:32:30 2020
(r367310)
@@ -68,19 +68,13 @@ struct comp_algo comp_algo_deflate = {
  */
 
 static uint32_t
-deflate_compress(data, size, out)
-   uint8_t *data;
-   uint32_t size;
-   uint8_t **out;
+deflate_compress(uint8_t *data, uint32_t size, uint8_t **out)
 {
return deflate_global(data, size, 0, out);
 }
 
 static uint32_t
-deflate_decompress(data, size, out)
-   uint8_t *data;
-   uint32_t size;
-   uint8_t **out;
+deflate_decompress(uint8_t *data, uint32_t size, uint8_t **out)
 {
return deflate_global(data, size, 1, out);
 }
___
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: r367309 - in head/sys: crypto crypto/chacha20 crypto/des crypto/rijndael crypto/skein opencrypto

2020-11-03 Thread John Baldwin
Author: jhb
Date: Tue Nov  3 22:27:54 2020
New Revision: 367309
URL: https://svnweb.freebsd.org/changeset/base/367309

Log:
  Consistently use C99 fixed-width types in the in-kernel crypto code.
  
  Reviewed by:  markj
  Sponsored by: Chelsio Communications
  Differential Revision:https://reviews.freebsd.org/D27061

Modified:
  head/sys/crypto/chacha20/chacha-sw.c
  head/sys/crypto/des/des.h
  head/sys/crypto/rijndael/rijndael-api-fst.c
  head/sys/crypto/rijndael/rijndael.h
  head/sys/crypto/rijndael/rijndael_local.h
  head/sys/crypto/sha1.c
  head/sys/crypto/sha1.h
  head/sys/crypto/skein/skein_port.h
  head/sys/opencrypto/crypto.c
  head/sys/opencrypto/cryptodeflate.c
  head/sys/opencrypto/cryptodev.c
  head/sys/opencrypto/cryptodev.h
  head/sys/opencrypto/cryptosoft.c
  head/sys/opencrypto/deflate.h
  head/sys/opencrypto/rmd160.c
  head/sys/opencrypto/rmd160.h
  head/sys/opencrypto/xform_auth.h
  head/sys/opencrypto/xform_comp.h
  head/sys/opencrypto/xform_deflate.c
  head/sys/opencrypto/xform_enc.h
  head/sys/opencrypto/xform_null.c
  head/sys/opencrypto/xform_rijndael.c
  head/sys/opencrypto/xform_sha1.c
  head/sys/opencrypto/xform_sha2.c

Modified: head/sys/crypto/chacha20/chacha-sw.c
==
--- head/sys/crypto/chacha20/chacha-sw.cTue Nov  3 22:13:16 2020
(r367308)
+++ head/sys/crypto/chacha20/chacha-sw.cTue Nov  3 22:27:54 2020
(r367309)
@@ -18,7 +18,7 @@ chacha20_xform_setkey(void *ctx, const uint8_t *key, i
 }
 
 static void
-chacha20_xform_reinit(void *ctx, const u_int8_t *iv)
+chacha20_xform_reinit(void *ctx, const uint8_t *iv)
 {
 
chacha_ivsetup(ctx, iv + 8, iv);

Modified: head/sys/crypto/des/des.h
==
--- head/sys/crypto/des/des.h   Tue Nov  3 22:13:16 2020(r367308)
+++ head/sys/crypto/des/des.h   Tue Nov  3 22:27:54 2020(r367309)
@@ -56,7 +56,7 @@ extern "C" {
 #endif
 
 /* must be 32bit quantity */
-#define DES_LONG u_int32_t
+#define DES_LONG uint32_t
 
 typedef unsigned char des_cblock[8];
 typedef struct des_ks_struct

Modified: head/sys/crypto/rijndael/rijndael-api-fst.c
==
--- head/sys/crypto/rijndael/rijndael-api-fst.c Tue Nov  3 22:13:16 2020
(r367308)
+++ head/sys/crypto/rijndael/rijndael-api-fst.c Tue Nov  3 22:27:54 2020
(r367309)
@@ -32,7 +32,7 @@ __FBSDID("$FreeBSD$");
 #define TRUE 1
 #endif
 
-typedef u_int8_t   BYTE;
+typedef uint8_tBYTE;
 
 int rijndael_makeKey(keyInstance *key, BYTE direction, int keyLen,
const char *keyMaterial) {
@@ -84,7 +84,7 @@ int rijndael_cipherInit(cipherInstance *cipher, BYTE m
 int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key,
const BYTE *input, int inputLen, BYTE *outBuffer) {
int i, k, numBlocks;
-   u_int8_t block[16], iv[4][4];
+   uint8_t block[16], iv[4][4];
 
if (cipher == NULL ||
key == NULL ||
@@ -110,15 +110,15 @@ int rijndael_blockEncrypt(cipherInstance *cipher, keyI
 #if 1 /*STRICT_ALIGN*/
memcpy(block, cipher->IV, 16);
memcpy(iv, input, 16);
-   ((u_int32_t*)block)[0] ^= ((u_int32_t*)iv)[0];
-   ((u_int32_t*)block)[1] ^= ((u_int32_t*)iv)[1];
-   ((u_int32_t*)block)[2] ^= ((u_int32_t*)iv)[2];
-   ((u_int32_t*)block)[3] ^= ((u_int32_t*)iv)[3];
+   ((uint32_t*)block)[0] ^= ((uint32_t*)iv)[0];
+   ((uint32_t*)block)[1] ^= ((uint32_t*)iv)[1];
+   ((uint32_t*)block)[2] ^= ((uint32_t*)iv)[2];
+   ((uint32_t*)block)[3] ^= ((uint32_t*)iv)[3];
 #else
-   ((u_int32_t*)block)[0] = ((u_int32_t*)cipher->IV)[0] ^ 
((u_int32_t*)input)[0];
-   ((u_int32_t*)block)[1] = ((u_int32_t*)cipher->IV)[1] ^ 
((u_int32_t*)input)[1];
-   ((u_int32_t*)block)[2] = ((u_int32_t*)cipher->IV)[2] ^ 
((u_int32_t*)input)[2];
-   ((u_int32_t*)block)[3] = ((u_int32_t*)cipher->IV)[3] ^ 
((u_int32_t*)input)[3];
+   ((uint32_t*)block)[0] = ((uint32_t*)cipher->IV)[0] ^ 
((uint32_t*)input)[0];
+   ((uint32_t*)block)[1] = ((uint32_t*)cipher->IV)[1] ^ 
((uint32_t*)input)[1];
+   ((uint32_t*)block)[2] = ((uint32_t*)cipher->IV)[2] ^ 
((uint32_t*)input)[2];
+   ((uint32_t*)block)[3] = ((uint32_t*)cipher->IV)[3] ^ 
((uint32_t*)input)[3];
 #endif
rijndaelEncrypt(key->rk, key->Nr, block, outBuffer);
input += 16;
@@ -126,15 +126,15 @@ int rijndael_blockEncrypt(cipherInstance *cipher, keyI
 #if 1 /*STRICT_ALIGN*/
memcpy(block, outBuffer, 16);
memcpy(iv, input, 16);
-   ((u_int32_t*)block)[0] ^= ((u_int32_t*)iv)[0];
-   ((u_int32_t*)block)[1] ^= ((u_int32_t*)iv

svn commit: r367308 - head/usr.bin/calendar

2020-11-03 Thread Stefan Eßer
Author: se
Date: Tue Nov  3 22:13:16 2020
New Revision: 367308
URL: https://svnweb.freebsd.org/changeset/base/367308

Log:
  Update man-page to document changes made to the calendar program.
  
  MFC after:3 days

Modified:
  head/usr.bin/calendar/calendar.1

Modified: head/usr.bin/calendar/calendar.1
==
--- head/usr.bin/calendar/calendar.1Tue Nov  3 22:04:32 2020
(r367307)
+++ head/usr.bin/calendar/calendar.1Tue Nov  3 22:13:16 2020
(r367308)
@@ -198,12 +198,20 @@ file is preprocessed by a limited subset of
 .Xr cpp 1
 internally, allowing the inclusion of shared files such as
 lists of company holidays or meetings.
-This limited subset consists of \fB#include #ifdef #ifndef #else
-#endif\fR and \fB#define\fR. Conditions can be nested, but not check
-for matching begin and end directives is performed.
-Included files are parsed in their own scope.
-They have no read or write access to condition variables defined in
-an outer scope and open conditional blocks are implicitly closed.
+This limited subset consists of \fB#include\fR, \fB#define\fR,
+\fB#undef\fR, \fB#ifdef\fR, \fB#ifndef\fR, and \fB#else\fR.
+.Pp
+Conditions can be nested and the consistency of opening and closing
+instructions is checked.
+Only the first word after #define is used as the name of the
+condition variable being defined.
+More than word following #ifdef, #ifndef, or #undef is a ayntax
+error, since names cannot include white-space.
+Included files are parsed in a global scope with regard to the condition
+variables being defined or tested therein.
+All conditional blocks are implicitly closed at the end of a file,
+and missing #endif instructions are assumed to be present on implied
+succeeding lines.
 .Pp
 If the shared file is not referenced by a full pathname,
 .Nm
___
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: r367307 - head/sbin/savecore

2020-11-03 Thread Gleb Smirnoff
Author: glebius
Date: Tue Nov  3 22:04:32 2020
New Revision: 367307
URL: https://svnweb.freebsd.org/changeset/base/367307

Log:
  Style, not functional changes:
  - Improve spelling of a false check [1]
  - A missing line from r367150.
  
  Submitted by: kib

Modified:
  head/sbin/savecore/savecore.c

Modified: head/sbin/savecore/savecore.c
==
--- head/sbin/savecore/savecore.c   Tue Nov  3 21:38:59 2020
(r367306)
+++ head/sbin/savecore/savecore.c   Tue Nov  3 22:04:32 2020
(r367307)
@@ -677,7 +677,7 @@ DoFile(const char *savedir, int savedirfd, const char 
dtoh32(kdhl.version), device);
 
status = STATUS_BAD;
-   if (force == false)
+   if (!force)
goto closefd;
}
} else if (compare_magic(&kdhl, KERNELDUMPMAGIC)) {
@@ -687,7 +687,7 @@ DoFile(const char *savedir, int savedirfd, const char 
dtoh32(kdhl.version), device);
 
status = STATUS_BAD;
-   if (force == false)
+   if (!force)
goto closefd;
}
switch (kdhl.compression) {
@@ -711,7 +711,7 @@ DoFile(const char *savedir, int savedirfd, const char 
device);
 
status = STATUS_BAD;
-   if (force == false)
+   if (!force)
goto closefd;
 
if (compare_magic(&kdhl, KERNELDUMPMAGIC_CLEARED)) {
@@ -728,7 +728,7 @@ DoFile(const char *savedir, int savedirfd, const char 
dtoh32(kdhl.version), device);
 
status = STATUS_BAD;
-   if (force == false)
+   if (!force)
goto closefd;
}
}
@@ -742,7 +742,7 @@ DoFile(const char *savedir, int savedirfd, const char 
"parity error on last dump header on %s", device);
nerr++;
status = STATUS_BAD;
-   if (force == false)
+   if (!force)
goto closefd;
}
dumpextent = dtoh64(kdhl.dumpextent);
@@ -773,7 +773,7 @@ DoFile(const char *savedir, int savedirfd, const char 
"first and last dump headers disagree on %s", device);
nerr++;
status = STATUS_BAD;
-   if (force == false)
+   if (!force)
goto closefd;
} else {
status = STATUS_GOOD;
@@ -1148,7 +1148,7 @@ main(int argc, char **argv)
verbose++;
break;
case 'z':
-   compress = 1;
+   compress = true;
break;
case '?':
default:
___
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: r367306 - head/sys/cam/mmc

2020-11-03 Thread Ilya Bakulin
Author: kibab
Date: Tue Nov  3 21:38:59 2020
New Revision: 367306
URL: https://svnweb.freebsd.org/changeset/base/367306

Log:
  Always return MMC errors from mmc_handle_reply()
  
  There are two ways to propagate the error in MMCCAM:
   * Using cmd.error which is set by the peripheral driver;
   * Using CCB status which is... also set by the driver.
  
  The problem is that those two error conditions don't necessarily match.
  This leads to the confusion when handling the MMC reply. So enforce the 
consistency
  by panicking if request is marked as completed successfully but MMC-level 
error
  is present (this hints to the programming error).
  
  Reviewed by:  manu
  Approved by:  imp (mentor)
  Differential Revision:https://reviews.freebsd.org/D26925

Modified:
  head/sys/cam/mmc/mmc_da.c

Modified: head/sys/cam/mmc/mmc_da.c
==
--- head/sys/cam/mmc/mmc_da.c   Tue Nov  3 20:43:01 2020(r367305)
+++ head/sys/cam/mmc/mmc_da.c   Tue Nov  3 21:38:59 2020(r367306)
@@ -239,31 +239,29 @@ get_rca(struct cam_periph *periph) {
 /*
  * Figure out if CCB execution resulted in error.
  * Look at both CAM-level errors and on MMC protocol errors.
+ *
+ * Return value is always MMC error.
 */
 static int
 mmc_handle_reply(union ccb *ccb)
 {
-
KASSERT(ccb->ccb_h.func_code == XPT_MMC_IO,
("ccb %p: cannot handle non-XPT_MMC_IO errors, got func_code=%d",
ccb, ccb->ccb_h.func_code));
 
-   /* TODO: maybe put MMC-specific handling into cam.c/cam_error_print 
altogether */
-   if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP)) {
-   if (ccb->mmcio.cmd.error != 0) {
-   xpt_print_path(ccb->ccb_h.path);
-   printf("CMD%d failed, err %d (%s)\n",
-  ccb->mmcio.cmd.opcode,
-  ccb->mmcio.cmd.error,
-  mmc_errmsg[ccb->mmcio.cmd.error]);
-   return (EIO);
-   }
-   } else {
-   cam_error_print(ccb, CAM_ESF_ALL, CAM_EPF_ALL);
-   return (EIO);
-   }
+   /* CAM-level error should always correspond to MMC-level error */
+   if (((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) &&
+ (ccb->mmcio.cmd.error != MMC_ERR_NONE))
+   panic("CCB status is OK but MMC error != MMC_ERR_NONE");
 
-   return (0); /* Normal return */
+   if (ccb->mmcio.cmd.error != MMC_ERR_NONE) {
+   xpt_print_path(ccb->ccb_h.path);
+   printf("CMD%d failed, err %d (%s)\n",
+ ccb->mmcio.cmd.opcode,
+ ccb->mmcio.cmd.error,
+ mmc_errmsg[ccb->mmcio.cmd.error]);
+   }
+   return (ccb->mmcio.cmd.error);
 }
 
 static uint32_t
___
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: r367305 - in stable/12: libexec/tftpd libexec/tftpd/tests usr.bin/tftp

2020-11-03 Thread John Baldwin
Author: jhb
Date: Tue Nov  3 20:43:01 2020
New Revision: 367305
URL: https://svnweb.freebsd.org/changeset/base/367305

Log:
  MFC 358556,360167: Add support for the TFTP windowsize option.
  
  358556:
  Add support for the TFTP windowsize option described in RFC 7440.
  
  The windowsize option permits multiple blocks to be transmitted
  before the receiver sends an ACK improving throughput for larger
  files.
  
  360167:
  Abort transfer if fseeko() fails.

Modified:
  stable/12/libexec/tftpd/tests/functional.c
  stable/12/libexec/tftpd/tftp-file.c
  stable/12/libexec/tftpd/tftp-file.h
  stable/12/libexec/tftpd/tftp-options.c
  stable/12/libexec/tftpd/tftp-options.h
  stable/12/libexec/tftpd/tftp-transfer.c
  stable/12/libexec/tftpd/tftp-utils.c
  stable/12/libexec/tftpd/tftp-utils.h
  stable/12/libexec/tftpd/tftpd.8
  stable/12/usr.bin/tftp/main.c
  stable/12/usr.bin/tftp/tftp.1
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/libexec/tftpd/tests/functional.c
==
--- stable/12/libexec/tftpd/tests/functional.c  Tue Nov  3 19:57:28 2020
(r367304)
+++ stable/12/libexec/tftpd/tests/functional.c  Tue Nov  3 20:43:01 2020
(r367305)
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -89,6 +90,13 @@ recv_ack(uint16_t blocknum)
RECV(hdr, NULL, 0);
 }
 
+static void
+recv_oack(const char *options, size_t options_len)
+{
+   char hdr[] = {0, 6};
+   RECV(hdr, options, options_len);
+}
+
 /*
  * Receive a data packet from tftpd
  * @param  blocknumExpected block number to be received
@@ -159,6 +167,11 @@ send_ack(uint16_t blocknum)
 
 }
 
+/*
+ * build an option string
+ */
+#define OPTION_STR(name, value)name "\000" value "\000"
+
 /* 
  * send a read request to tftpd.
  * @param  filenamefilename as a string, absolute or relative
@@ -166,6 +179,11 @@ send_ack(uint16_t blocknum)
  */
 #define SEND_RRQ(filename, mode) SEND_STR("\0\001" filename "\0" mode "\0")
 
+/*
+ * send a read request with options
+ */
+#define SEND_RRQ_OPT(filename, mode, options) SEND_STR("\0\001" filename "\0" 
mode "\000" options)
+
 /* 
  * send a write request to tftpd.
  * @param  filenamefilename as a string, absolute or relative
@@ -173,6 +191,11 @@ send_ack(uint16_t blocknum)
  */
 #define SEND_WRQ(filename, mode) SEND_STR("\0\002" filename "\0" mode "\0")
 
+/*
+ * send a write request with options
+ */
+#define SEND_WRQ_OPT(filename, mode, options) SEND_STR("\0\002" filename "\0" 
mode "\000" options)
+
 /* Define a test case, for both IPv4 and IPv6 */
 #define TFTPD_TC_DEFINE(name, head, ...) \
 static void \
@@ -573,6 +596,32 @@ TFTPD_TC_DEFINE(rrq_medium,)
 }
 
 /*
+ * Read a medium file with a window size of 2.
+ */
+TFTPD_TC_DEFINE(rrq_medium_window,)
+{
+   int fd;
+   size_t i;
+   uint32_t contents[192];
+   char options[] = OPTION_STR("windowsize", "2");
+
+   for (i = 0; i < nitems(contents); i++)
+   contents[i] = i;
+
+   fd = open("medium.txt", O_RDWR | O_CREAT, 0644);
+   ATF_REQUIRE(fd >= 0);
+   write_all(fd, contents, sizeof(contents));
+   close(fd);
+
+   SEND_RRQ_OPT("medium.txt", "octet", OPTION_STR("windowsize", "2"));
+   recv_oack(options, sizeof(options) - 1);
+   send_ack(0);
+   recv_data(1, (const char*)&contents[0], 512);
+   recv_data(2, (const char*)&contents[128], 256);
+   send_ack(2);
+}
+
+/*
  * Read a file in netascii format
  */
 TFTPD_TC_DEFINE(rrq_netascii,)
@@ -652,6 +701,59 @@ TFTPD_TC_DEFINE(rrq_small,)
 }
 
 /*
+ * Read a file following the example in RFC 7440.
+ */
+TFTPD_TC_DEFINE(rrq_window_rfc7440,)
+{
+   int fd;
+   size_t i;
+   char options[] = OPTION_STR("windowsize", "4");
+   alignas(uint32_t) char contents[13 * 512 - 4];
+   uint32_t *u32p;
+
+   u32p = (uint32_t *)contents;
+   for (i = 0; i < sizeof(contents) / sizeof(uint32_t); i++)
+   u32p[i] = i;
+
+   fd = open("rfc7440.txt", O_RDWR | O_CREAT, 0644);
+   ATF_REQUIRE(fd >= 0);
+   write_all(fd, contents, sizeof(contents));
+   close(fd);
+
+   SEND_RRQ_OPT("rfc7440.txt", "octet", OPTION_STR("windowsize", "4"));
+   recv_oack(options, sizeof(options) - 1);
+   send_ack(0);
+   recv_data(1, &contents[0 * 512], 512);
+   recv_data(2, &contents[1 * 512], 512);
+   recv_data(3, &contents[2 * 512], 512);
+   recv_data(4, &contents[3 * 512], 512);
+   send_ack(4);
+   recv_data(5, &contents[4 * 512], 512);
+   recv_data(6, &contents[5 * 512], 512);
+   recv_data(7, &contents[6 * 512], 512);
+   recv_data(8, &contents[7 * 512], 512);
+
+   /* ACK 5 as if 6-8 were dropped. */
+   send_ack(5);
+   recv_data(6, &contents[5 * 512], 512);
+   recv_data(7, &contents[6 * 512], 512);
+   recv_data(8, &contents[

svn commit: r367304 - in head: share/man/man5 share/mk tools/build/options usr.bin usr.bin/clang usr.bin/clang/llvm-cxxfilt

2020-11-03 Thread Dimitry Andric
Author: dim
Date: Tue Nov  3 19:57:28 2020
New Revision: 367304
URL: https://svnweb.freebsd.org/changeset/base/367304

Log:
  Add WITH_LLVM_CXXFILT option to install llvm-cxxfilt as c++filt
  
  Since elftoolchain's cxxfilt is rather far behind on features, and we
  ran into several bugs, add an option to use llvm-cxxfilt as an drop-in
  replacement.
  
  It supports the same options as elftoolchain cxxfilt, though it doesn't
  have support for old ARM (C++ Annotated Reference Manual, not the CPU)
  and GNU v2 manglings. But these are irrelevant in 2020.
  
  Note: as we already compile the required libraries as part of libllvm,
  this will not add any significant build time either.
  
  PR:   250702
  Reviewed by:  emaste, yuri
  Differential Revision: https://reviews.freebsd.org/D27071
  MFC after:2 weeks

Added:
  head/tools/build/options/WITHOUT_LLVM_CXXFILT   (contents, props changed)
  head/tools/build/options/WITH_LLVM_CXXFILT   (contents, props changed)
Modified:
  head/share/man/man5/src.conf.5
  head/share/mk/src.opts.mk
  head/usr.bin/Makefile
  head/usr.bin/clang/Makefile
  head/usr.bin/clang/llvm-cxxfilt/Makefile

Modified: head/share/man/man5/src.conf.5
==
--- head/share/man/man5/src.conf.5  Tue Nov  3 19:50:42 2020
(r367303)
+++ head/share/man/man5/src.conf.5  Tue Nov  3 19:57:28 2020
(r367304)
@@ -1,6 +1,6 @@
 .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman.
 .\" $FreeBSD$
-.Dd September 15, 2020
+.Dd November 3, 2020
 .Dt SRC.CONF 5
 .Os
 .Sh NAME
@@ -919,6 +919,8 @@ Set to disable debugging assertions in LLVM.
 Set to not build the
 .Xr llvm-cov 1
 tool.
+.It Va WITH_LLVM_CXXFILT
+Install LLVM's llvm-cxxfilt as c++filt, instead of ELF Tool Chain's cxxfilt.
 .It Va WITHOUT_LLVM_TARGET_AARCH64
 Set to not build LLVM target support for AArch64.
 The

Modified: head/share/mk/src.opts.mk
==
--- head/share/mk/src.opts.mk   Tue Nov  3 19:50:42 2020(r367303)
+++ head/share/mk/src.opts.mk   Tue Nov  3 19:57:28 2020(r367304)
@@ -210,6 +210,7 @@ __DEFAULT_NO_OPTIONS = \
 GNU_GREP_COMPAT \
 HESIOD \
 LIBSOFT \
+LLVM_CXXFILT \
 LOADER_FIREWIRE \
 LOADER_VERBOSE \
 LOADER_VERIEXEC_PASS_MANIFEST \

Added: head/tools/build/options/WITHOUT_LLVM_CXXFILT
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITHOUT_LLVM_CXXFILT   Tue Nov  3 19:57:28 
2020(r367304)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Install ELF Tool Chain's cxxfilt as c++filt, instead of LLVM's llvm-cxxfilt.

Added: head/tools/build/options/WITH_LLVM_CXXFILT
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/tools/build/options/WITH_LLVM_CXXFILT  Tue Nov  3 19:57:28 2020
(r367304)
@@ -0,0 +1,2 @@
+.\" $FreeBSD$
+Install LLVM's llvm-cxxfilt as c++filt, instead of ELF Tool Chain's cxxfilt.

Modified: head/usr.bin/Makefile
==
--- head/usr.bin/Makefile   Tue Nov  3 19:50:42 2020(r367303)
+++ head/usr.bin/Makefile   Tue Nov  3 19:57:28 2020(r367304)
@@ -260,7 +260,9 @@ SUBDIR.${MK_TOOLCHAIN}+=ar
 SUBDIR.${MK_TOOLCHAIN}+=   c89
 SUBDIR.${MK_TOOLCHAIN}+=   c99
 SUBDIR.${MK_TOOLCHAIN}+=   ctags
+.if ${MK_LLVM_CXXFILT} == "no"
 SUBDIR.${MK_TOOLCHAIN}+=   cxxfilt
+.endif
 SUBDIR.${MK_TOOLCHAIN}+=   objcopy
 SUBDIR.${MK_TOOLCHAIN}+=   file2c
 SUBDIR.${MK_TOOLCHAIN}+=   gprof

Modified: head/usr.bin/clang/Makefile
==
--- head/usr.bin/clang/Makefile Tue Nov  3 19:50:42 2020(r367303)
+++ head/usr.bin/clang/Makefile Tue Nov  3 19:57:28 2020(r367304)
@@ -16,6 +16,10 @@ SUBDIR+= llvm-nm
 SUBDIR+=   llvm-objdump
 SUBDIR+=   llvm-symbolizer
 
+.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLVM_CXXFILT} != "no"
+SUBDIR+=   llvm-cxxfilt
+.endif
+
 .if ${MK_CLANG_EXTRAS} != "no"
 SUBDIR+=   bugpoint
 SUBDIR+=   llc
@@ -23,7 +27,6 @@ SUBDIR+=  lli
 SUBDIR+=   llvm-as
 SUBDIR+=   llvm-bcanalyzer
 SUBDIR+=   llvm-cxxdump
-SUBDIR+=   llvm-cxxfilt
 SUBDIR+=   llvm-diff
 SUBDIR+=   llvm-dis
 SUBDIR+=   llvm-dwarfdump

Modified: head/usr.bin/clang/llvm-cxxfilt/Makefile
==
--- head/usr.bin/clang/llvm-cxxfilt/MakefileTue Nov  3 19:50:42 2020
(r367303)
+++ head/usr.bin/clang/llvm-cxxfilt/MakefileTue Nov  3 19:57:28 2020
(r367304)
@@ -1,8 +1,15 @@
 # $FreeBSD$
 
+.include 
+
 PROG_CXX=  llvm-cxxfilt
 
 SRCDIR= 

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

2020-11-03 Thread Conrad Meyer
Author: cem
Date: Tue Nov  3 19:50:42 2020
New Revision: 367303
URL: https://svnweb.freebsd.org/changeset/base/367303

Log:
  linux(4): Improve netlink diagnostics
  
  Add some missing netlink_family definitions and produce vaguely
  human-readable error messages for those definitions, like we used to do for
  just ROUTE and KOBJECT_UEVENTS.
  
  Additionally, if we know it's a netfilter socket but didn't find it in the
  table, fall back to printing that instead of the generic handler ("socket
  domain 16, ...").
  
  No change to the emulator correctness, just mildly improved diagnostics for
  gaps.

Modified:
  head/sys/compat/linux/linux.h
  head/sys/compat/linux/linux_socket.c

Modified: head/sys/compat/linux/linux.h
==
--- head/sys/compat/linux/linux.h   Tue Nov  3 19:14:03 2020
(r367302)
+++ head/sys/compat/linux/linux.h   Tue Nov  3 19:50:42 2020
(r367303)
@@ -60,8 +60,14 @@ struct l_sockaddr {
 #defineLINUX_AF_INET6  10
 #defineLINUX_AF_NETLINK16
 
-#defineLINUX_NETLINK_ROUTE 0
-#defineLINUX_NETLINK_UEVENT15
+#defineLINUX_NETLINK_ROUTE 0
+#defineLINUX_NETLINK_SOCK_DIAG 4
+#defineLINUX_NETLINK_NFLOG 5
+#defineLINUX_NETLINK_SELINUX   7
+#defineLINUX_NETLINK_AUDIT 9
+#defineLINUX_NETLINK_FIB_LOOKUP10
+#defineLINUX_NETLINK_NETFILTER 12
+#defineLINUX_NETLINK_KOBJECT_UEVENT15
 
 /*
  * net device flags

Modified: head/sys/compat/linux/linux_socket.c
==
--- head/sys/compat/linux/linux_socket.cTue Nov  3 19:14:03 2020
(r367302)
+++ head/sys/compat/linux/linux_socket.cTue Nov  3 19:50:42 2020
(r367303)
@@ -502,6 +502,17 @@ goout:
return (error);
 }
 
+static const char *linux_netlink_names[] = {
+   [LINUX_NETLINK_ROUTE] = "ROUTE",
+   [LINUX_NETLINK_SOCK_DIAG] = "SOCK_DIAG",
+   [LINUX_NETLINK_NFLOG] = "NFLOG",
+   [LINUX_NETLINK_SELINUX] = "SELINUX",
+   [LINUX_NETLINK_AUDIT] = "AUDIT",
+   [LINUX_NETLINK_FIB_LOOKUP] = "FIB_LOOKUP",
+   [LINUX_NETLINK_NETFILTER] = "NETFILTER",
+   [LINUX_NETLINK_KOBJECT_UEVENT] = "KOBJECT_UEVENT",
+};
+
 int
 linux_socket(struct thread *td, struct linux_socket_args *args)
 {
@@ -516,22 +527,29 @@ linux_socket(struct thread *td, struct linux_socket_ar
return (retval_socket);
domain = linux_to_bsd_domain(args->domain);
if (domain == -1) {
-   if (args->domain == LINUX_AF_NETLINK &&
-   args->protocol == LINUX_NETLINK_ROUTE) {
-   linux_msg(curthread,
-   "unsupported socket(AF_NETLINK, %d, 
NETLINK_ROUTE)", type);
-   return (EAFNOSUPPORT);
+   /* Mask off SOCK_NONBLOCK / CLOEXEC for error messages. */
+   type = args->type & LINUX_SOCK_TYPE_MASK;
+   if (args->domain == LINUX_AF_NETLINK) {
+   const char *nl_name;
+
+   if (args->protocol >= 0 &&
+   args->protocol < nitems(linux_netlink_names))
+   nl_name = linux_netlink_names[args->protocol];
+   else
+   nl_name = NULL;
+   if (nl_name != NULL)
+   linux_msg(curthread,
+   "unsupported socket(AF_NETLINK, %d, "
+   "NETLINK_%s)", type, nl_name);
+   else
+   linux_msg(curthread,
+   "unsupported socket(AF_NETLINK, %d, %d)",
+   type, args->protocol);
+   } else {
+   linux_msg(curthread, "unsupported socket domain %d, "
+   "type %d, protocol %d", args->domain, type,
+   args->protocol);
}
-   
-   if (args->domain == LINUX_AF_NETLINK &&
-   args->protocol == LINUX_NETLINK_UEVENT) {
-   linux_msg(curthread,
-   "unsupported socket(AF_NETLINK, %d, 
NETLINK_UEVENT)", type);
-   return (EAFNOSUPPORT);
-   }
-   
-   linux_msg(curthread, "unsupported socket domain %d, type %d, 
protocol %d",
-   args->domain, args->type & LINUX_SOCK_TYPE_MASK, 
args->protocol);
return (EAFNOSUPPORT);
}
 
___
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: r367302 - head/sys/kern

2020-11-03 Thread Brooks Davis
Author: brooks
Date: Tue Nov  3 19:14:03 2020
New Revision: 367302
URL: https://svnweb.freebsd.org/changeset/base/367302

Log:
  sysvshm: pass relevant uap members as arguments
  
  Alter shmget_allocate_segment and shmget_existing to take the values
  they want from struct shmget_args rather than passing the struct
  around.  In general, uap structures should only be the interface to
  sys_ functions.
  
  This makes on small functional change and records the allocated space
  rather than the requested space.  If this turns out to be a problem (e.g.
  if software tries to find undersized segments by exact size rather than
  using keys), we can correct that easily.
  
  Reviewed by:  kib
  Obtained from:CheriBSD
  MFC after:1 week
  Sponsored by: DARPA
  Differential Revision:https://reviews.freebsd.org/D27077

Modified:
  head/sys/kern/sysv_shm.c

Modified: head/sys/kern/sysv_shm.c
==
--- head/sys/kern/sysv_shm.cTue Nov  3 19:12:33 2020(r367301)
+++ head/sys/kern/sysv_shm.cTue Nov  3 19:14:03 2020(r367302)
@@ -111,11 +111,6 @@ FEATURE(sysv_shm, "System V shared memory segments sup
 
 static MALLOC_DEFINE(M_SHM, "shm", "SVID compatible shared memory segments");
 
-static int shmget_allocate_segment(struct thread *td,
-struct shmget_args *uap, int mode);
-static int shmget_existing(struct thread *td, struct shmget_args *uap,
-int mode, int segnum);
-
 #defineSHMSEG_FREE 0x0200
 #defineSHMSEG_REMOVED  0x0400
 #defineSHMSEG_ALLOCATED0x0800
@@ -134,6 +129,10 @@ static void shm_deallocate_segment(struct shmid_kernel
 static int shm_find_segment_by_key(struct prison *, key_t);
 static struct shmid_kernel *shm_find_segment(struct prison *, int, bool);
 static int shm_delete_mapping(struct vmspace *vm, struct shmmap_state *);
+static int shmget_allocate_segment(struct thread *td, key_t key, size_t size,
+int mode);
+static int shmget_existing(struct thread *td, size_t size, int shmflg,
+int mode, int segnum);
 static void shmrealloc(void);
 static int shminit(void);
 static int sysvshm_modload(struct module *, int, void *);
@@ -659,7 +658,7 @@ done:
 }
 
 static int
-shmget_existing(struct thread *td, struct shmget_args *uap, int mode,
+shmget_existing(struct thread *td, size_t size, int shmflg, int mode,
 int segnum)
 {
struct shmid_kernel *shmseg;
@@ -671,35 +670,34 @@ shmget_existing(struct thread *td, struct shmget_args 
KASSERT(segnum >= 0 && segnum < shmalloced,
("segnum %d shmalloced %d", segnum, shmalloced));
shmseg = &shmsegs[segnum];
-   if ((uap->shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL))
+   if ((shmflg & (IPC_CREAT | IPC_EXCL)) == (IPC_CREAT | IPC_EXCL))
return (EEXIST);
 #ifdef MAC
-   error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, uap->shmflg);
+   error = mac_sysvshm_check_shmget(td->td_ucred, shmseg, shmflg);
if (error != 0)
return (error);
 #endif
-   if (uap->size != 0 && uap->size > shmseg->u.shm_segsz)
+   if (size != 0 && size > shmseg->u.shm_segsz)
return (EINVAL);
td->td_retval[0] = IXSEQ_TO_IPCID(segnum, shmseg->u.shm_perm);
return (0);
 }
 
 static int
-shmget_allocate_segment(struct thread *td, struct shmget_args *uap, int mode)
+shmget_allocate_segment(struct thread *td, key_t key, size_t size, int mode)
 {
struct ucred *cred = td->td_ucred;
struct shmid_kernel *shmseg;
vm_object_t shm_object;
int i, segnum;
-   size_t size;
 
SYSVSHM_ASSERT_LOCKED();
 
-   if (uap->size < shminfo.shmmin || uap->size > shminfo.shmmax)
+   if (size < shminfo.shmmin || size > shminfo.shmmax)
return (EINVAL);
if (shm_nused >= shminfo.shmmni) /* Any shmids left? */
return (ENOSPC);
-   size = round_page(uap->size);
+   size = round_page(size);
if (shm_committed + btoc(size) > shminfo.shmall)
return (ENOMEM);
if (shm_last_free < 0) {
@@ -755,10 +753,10 @@ shmget_allocate_segment(struct thread *td, struct shmg
shmseg->u.shm_perm.cuid = shmseg->u.shm_perm.uid = cred->cr_uid;
shmseg->u.shm_perm.cgid = shmseg->u.shm_perm.gid = cred->cr_gid;
shmseg->u.shm_perm.mode = (mode & ACCESSPERMS) | SHMSEG_ALLOCATED;
-   shmseg->u.shm_perm.key = uap->key;
+   shmseg->u.shm_perm.key = key;
shmseg->u.shm_perm.seq = (shmseg->u.shm_perm.seq + 1) & 0x7fff;
shmseg->cred = crhold(cred);
-   shmseg->u.shm_segsz = uap->size;
+   shmseg->u.shm_segsz = size;
shmseg->u.shm_cpid = td->td_proc->p_pid;
shmseg->u.shm_lpid = shmseg->u.shm_nattch = 0;
shmseg->u.shm_atime = shmseg->u.shm_dtime = 0;
@@ -791,16 +789,18 @@ sys_shmget(struct thread *td, struct shmget_args *uap)
mode = ua

svn commit: r367301 - in head: lib/libsysdecode sys/compat/linux sys/modules/linux_common

2020-11-03 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Nov  3 19:12:33 2020
New Revision: 367301
URL: https://svnweb.freebsd.org/changeset/base/367301

Log:
  Make linux_errtbl[] static.
  
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation
  Differential Revision:https://reviews.freebsd.org/D27004

Modified:
  head/lib/libsysdecode/errno.c
  head/sys/compat/linux/linux_emul.h
  head/sys/compat/linux/linux_errno.inc
  head/sys/modules/linux_common/Makefile

Modified: head/lib/libsysdecode/errno.c
==
--- head/lib/libsysdecode/errno.c   Tue Nov  3 18:13:42 2020
(r367300)
+++ head/lib/libsysdecode/errno.c   Tue Nov  3 19:12:33 2020
(r367301)
@@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$");
 
 #if defined(__aarch64__) || defined(__amd64__) || defined(__i386__)
 #include 
-static
 #include 
 #endif
 

Modified: head/sys/compat/linux/linux_emul.h
==
--- head/sys/compat/linux/linux_emul.h  Tue Nov  3 18:13:42 2020
(r367300)
+++ head/sys/compat/linux/linux_emul.h  Tue Nov  3 19:12:33 2020
(r367301)
@@ -80,6 +80,4 @@ struct linux_pemuldata {
 
 struct linux_pemuldata *pem_find(struct proc *);
 
-extern const int linux_errtbl[];
-
 #endif /* !_LINUX_EMUL_H_ */

Modified: head/sys/compat/linux/linux_errno.inc
==
--- head/sys/compat/linux/linux_errno.inc   Tue Nov  3 18:13:42 2020
(r367300)
+++ head/sys/compat/linux/linux_errno.inc   Tue Nov  3 19:12:33 2020
(r367301)
@@ -38,7 +38,7 @@
  * XXX: The "XXX" comments below should be replaced with rationale
  *  for the errno value chosen.
  */
-const int linux_errtbl[ELAST + 1] = {
+static const int linux_errtbl[ELAST + 1] = {
/* [0, 9] */
[0] = -0,
[EPERM] = -LINUX_EPERM,

Modified: head/sys/modules/linux_common/Makefile
==
--- head/sys/modules/linux_common/Makefile  Tue Nov  3 18:13:42 2020
(r367300)
+++ head/sys/modules/linux_common/Makefile  Tue Nov  3 19:12:33 2020
(r367301)
@@ -9,7 +9,6 @@ SRCS=   linux_common.c linux_mib.c linux_mmap.c linux_ut
 
 EXPORT_SYMS=
 EXPORT_SYMS+=  linux_emul_path
-EXPORT_SYMS+=  linux_errtbl
 EXPORT_SYMS+=  linux_ioctl_register_handler
 EXPORT_SYMS+=  linux_ioctl_unregister_handler
 EXPORT_SYMS+=  linux_get_osname
___
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: r367300 - head/share/man/man7

2020-11-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Tue Nov  3 18:13:42 2020
New Revision: 367300
URL: https://svnweb.freebsd.org/changeset/base/367300

Log:
  build.7: Mention etcupdate(8) alongside mergemaster(8)
  
  MFC after:3 days

Modified:
  head/share/man/man7/build.7

Modified: head/share/man/man7/build.7
==
--- head/share/man/man7/build.7 Tue Nov  3 18:02:02 2020(r367299)
+++ head/share/man/man7/build.7 Tue Nov  3 18:13:42 2020(r367300)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd September 11, 2020
+.Dd November 3, 2020
 .Dt BUILD 7
 .Os
 .Sh NAME
@@ -864,6 +864,7 @@ manpage first appeared in
 .Xr release 7 ,
 .Xr tests 7 ,
 .Xr config 8 ,
+.Xr etcupdate 8 ,
 .Xr mergemaster 8 ,
 .Xr reboot 8 ,
 .Xr shutdown 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: r367299 - head/share/man/man7

2020-11-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Tue Nov  3 18:02:02 2020
New Revision: 367299
URL: https://svnweb.freebsd.org/changeset/base/367299

Log:
  Fix a typo in the description of WITH_DEBUG_PORTS
  
  For each origin listed in WITH_DEBUG_PORTS, the ports framework sets
  WITH_DEBUG instead of WITH_DEBUG_PORTS.
  
  MFC after:3 days

Modified:
  head/share/man/man7/ports.7

Modified: head/share/man/man7/ports.7
==
--- head/share/man/man7/ports.7 Tue Nov  3 14:44:33 2020(r367298)
+++ head/share/man/man7/ports.7 Tue Nov  3 18:02:02 2020(r367299)
@@ -560,7 +560,7 @@ Porter's Handbook.
 If set, debugging symbols are installed for ports binaries.
 .It Va WITH_DEBUG_PORTS
 A list of origins for which to set
-.Va WITH_DEBUG_PORTS .
+.Va WITH_DEBUG .
 .It Va WITH_CCACHE_BUILD
 .Pq Vt bool
 If set, enables the use of
___
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: r367298 - head/sys/compat/linux

2020-11-03 Thread Edward Tomasz Napierala
Author: trasz
Date: Tue Nov  3 14:44:33 2020
New Revision: 367298
URL: https://svnweb.freebsd.org/changeset/base/367298

Log:
  Fix rookie mistake - it's nitems(), not sizeof().
  
  Reported by:  xtouqh_icloud.com
  MFC after:2 weeks
  Sponsored by: The FreeBSD Foundation

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

Modified: head/sys/compat/linux/linux_errno.c
==
--- head/sys/compat/linux/linux_errno.c Tue Nov  3 14:41:49 2020
(r367297)
+++ head/sys/compat/linux/linux_errno.c Tue Nov  3 14:44:33 2020
(r367298)
@@ -27,7 +27,7 @@ linux_check_errtbl(void)
 {
int i;
 
-   for (i = 1; i < sizeof(linux_errtbl); i++) {
+   for (i = 1; i < nitems(linux_errtbl); i++) {
KASSERT(linux_errtbl[i] != 0,
("%s: linux_errtbl[%d] == 0", __func__, 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: r367297 - stable/12

2020-11-03 Thread Mark Johnston
Author: markj
Date: Tue Nov  3 14:41:49 2020
New Revision: 367297
URL: https://svnweb.freebsd.org/changeset/base/367297

Log:
  MFC r367081:
  arm64: Remove a racy KASSERT from pmap_remove_pages()

Modified:
Directory Properties:
  stable/12/   (props changed)
___
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: r367296 - head/sys/net

2020-11-03 Thread Konstantin Belousov
Author: kib
Date: Tue Nov  3 14:33:04 2020
New Revision: 367296
URL: https://svnweb.freebsd.org/changeset/base/367296

Log:
  if_media.c SIOCGMEDIAX handler: improve loop
  
  Stop advancing counter past the current iteration number at the start
  of iteration.  This removes the need of subtracting one when
  calculating index for copyout, and arguably fixes off-by-one reporting
  of copied out elements when copyout failed.
  
  Reviewed by:  hselasky
  Sponsored by: Mellanox Technologies / NVidia Networking
  MFC after:1 week
  Differential revision:https://reviews.freebsd.org/D27073

Modified:
  head/sys/net/if_media.c

Modified: head/sys/net/if_media.c
==
--- head/sys/net/if_media.c Tue Nov  3 13:26:00 2020(r367295)
+++ head/sys/net/if_media.c Tue Nov  3 14:33:04 2020(r367296)
@@ -300,15 +300,17 @@ ifmedia_ioctl(struct ifnet *ifp, struct ifreq *ifr, st
 * allocate.
 */
i = 0;
-   LIST_FOREACH(ep, &ifm->ifm_list, ifm_list)
-   if (i++ < ifmr->ifm_count) {
+   LIST_FOREACH(ep, &ifm->ifm_list, ifm_list) {
+   if (i < ifmr->ifm_count) {
error = copyout(&ep->ifm_media,
-   ifmr->ifm_ulist + i - 1, sizeof(int));
-   if (error)
+   ifmr->ifm_ulist + i, sizeof(int));
+   if (error != 0)
break;
}
+   i++;
+   }
if (error == 0 && i > ifmr->ifm_count)
-   error = ifmr->ifm_count ? E2BIG : 0;
+   error = ifmr->ifm_count != 0 ? E2BIG : 0;
ifmr->ifm_count = i;
break;
}
___
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: r367295 - head/share/man/man7

2020-11-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Tue Nov  3 13:26:00 2020
New Revision: 367295
URL: https://svnweb.freebsd.org/changeset/base/367295

Log:
  Document how to set ports options via make.conf(5)
  
  This patch is based on:
  - 
https://lists.freebsd.org/pipermail/freebsd-ports-announce/2013-June/62.html
  - current content of /usr/ports/Mk/bsd.options.mk
  
  PR:   194306
  Reported by:  Daan K. 
  MFC after:2 weeks

Modified:
  head/share/man/man7/ports.7

Modified: head/share/man/man7/ports.7
==
--- head/share/man/man7/ports.7 Tue Nov  3 12:29:10 2020(r367294)
+++ head/share/man/man7/ports.7 Tue Nov  3 13:26:00 2020(r367295)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 1, 2020
+.Dd November 3, 2020
 .Dt PORTS 7
 .Os
 .Sh NAME
@@ -615,6 +615,25 @@ is going to be built with Python 3.7 support.)
 .Li # Ic cd /usr/ports/devel/py-pip
 .Li # Ic env FLAVOR=py37 make build
 .Ed
+.It Sy Example 4\&: No Setting Ports Options via Xr make.conf 5
+.Pp
+The following lines present various ways of configuring ports options via
+.Xr make.conf 5
+(as an alternative to, e.g., running
+.Dq Li make config ) :
+.Bd -literal -offset 2n
+# Enable NLS for all ports unless configured otherwise
+# using the options dialog.
+OPTIONS_SET=   NLS
+# Disable DOCS for all ports overriding the options set
+# via the options dialog.
+OPTIONS_UNSET_FORCE=   DOCS
+# Disable DOCS and EXAMPLES for the shells/zsh port.
+shells_zsh_UNSET=  DOCS EXAMPLES
+.Ed
+.Pp
+These and other options-related variables are documented in
+.Pa /usr/ports/Mk/bsd.options.mk .
 .El
 .Sh SEE ALSO
 .Xr make 1 ,
___
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: r367294 - head/libexec/rc

2020-11-03 Thread Stefan Eßer
Author: se
Date: Tue Nov  3 12:29:10 2020
New Revision: 367294
URL: https://svnweb.freebsd.org/changeset/base/367294

Log:
  Replace literal uses of /usr/local with a variable
  
  The variable defaults to "/usr/local", unless sysctl returns some other
  value for "user.localbase".
  
  The value of user.localbase defaults to _PATH_LOCALBASE as defined in
  paths.h and thus this commit has no immediate effect.
  
  The purpose of this change is to make /etc/defaults/rc.conf automatically
  use the value of _PATH_LOCALBASE when not set to the default value.
  
  Reviewed by:  imp, scottl
  MFC after:1 month
  Differential Revision:https://reviews.freebsd.org/D27014

Modified:
  head/libexec/rc/rc
  head/libexec/rc/rc.conf

Modified: head/libexec/rc/rc
==
--- head/libexec/rc/rc  Tue Nov  3 12:15:08 2020(r367293)
+++ head/libexec/rc/rc  Tue Nov  3 12:29:10 2020(r367294)
@@ -59,6 +59,8 @@ else
_boot="quietstart"
 fi
 
+_localbase=`/sbin/sysctl -n user.localbase 2> /dev/null`
+
 dlv=`/sbin/sysctl -n vfs.nfs.diskless_valid 2> /dev/null`
 if [ ${dlv:=0} -ne 0 -o -f /etc/diskless ]; then
sh /etc/rc.initdiskless

Modified: head/libexec/rc/rc.conf
==
--- head/libexec/rc/rc.conf Tue Nov  3 12:15:08 2020(r367293)
+++ head/libexec/rc/rc.conf Tue Nov  3 12:29:10 2020(r367294)
@@ -21,6 +21,9 @@
 ###  Important initial Boot-time options  
 ##
 
+# Set default value of _localbase if not previously set
+: ${_localbase:="/usr/local"}
+
 # rc_debug can't be set here without interferring with rc.subr's setting it
 # when the kenv variable rc.debug is set.
 #rc_debug="NO" # Set to YES to enable debugging output from rc.d
@@ -58,7 +61,7 @@ varmfs_flags="-S" # Extra mount options for the mfs /v
 mfs_type="auto"# "md", "tmpfs", "auto" to prefer tmpfs with md 
as fallback
 populate_var="AUTO"# Set to YES to always (re)populate /var, NO to never
 cleanvar_enable="YES"  # Clean the /var directory
-local_startup="/usr/local/etc/rc.d" # startup script dirs.
+local_startup="${_localbase}/etc/rc.d" # startup script dirs.
 script_name_sep=" "# Change if your startup scripts' names contain spaces
 rc_conf_files="/etc/rc.conf /etc/rc.conf.local"
 
@@ -188,7 +191,7 @@ ipfw_netflow_enable="NO"# Enable netflow logging via 
 ip_portrange_first="NO"# Set first dynamically allocated port
 ip_portrange_last="NO" # Set last dynamically allocated port
 ike_enable="NO"# Enable IKE daemon (usually racoon or 
isakmpd)
-ike_program="/usr/local/sbin/isakmpd"  # Path to IKE daemon
+ike_program="${_localbase}/sbin/isakmpd"   # Path to IKE daemon
 ike_flags=""   # Additional flags for IKE daemon
 ipsec_enable="NO"  # Set to YES to run setkey on ipsec_file
 ipsec_file="/etc/ipsec.conf"   # Name of config file for setkey
@@ -647,19 +650,19 @@ linux_mounts_enable="YES" # If linux_enable is set to 
 clear_tmp_enable="NO"  # Clear /tmp at startup.
 clear_tmp_X="YES"  # Clear and recreate X11-related directories in /tmp
 ldconfig_insecure="NO" # Set to YES to disable ldconfig security checks
-ldconfig_paths="/usr/lib/compat /usr/local/lib /usr/local/lib/compat/pkg"
+ldconfig_paths="/usr/lib/compat ${_localbase}/lib ${_localbase}/lib/compat/pkg"
# shared library search paths
 ldconfig32_paths="/usr/lib32 /usr/lib32/compat"
# 32-bit compatibility shared library search paths
-ldconfigsoft_paths="/usr/libsoft /usr/libsoft/compat /usr/local/libsoft"
+ldconfigsoft_paths="/usr/libsoft /usr/libsoft/compat ${_localbase}/libsoft"
# soft float compatibility shared library search paths
# Note: temporarily with extra stuff for transition
-ldconfig_local_dirs="/usr/local/libdata/ldconfig"
+ldconfig_local_dirs="${_localbase}/libdata/ldconfig"
# Local directories with ldconfig configuration files.
-ldconfig_local32_dirs="/usr/local/libdata/ldconfig32"
+ldconfig_local32_dirs="${_localbase}/libdata/ldconfig32"
# Local directories with 32-bit compatibility ldconfig
# configuration files.
-ldconfig_localsoft_dirs="/usr/local/libdata/ldconfigsoft"
+ldconfig_localsoft_dirs="${_localbase}/libdata/ldconfigsoft"
# Local directories with soft float compatibility 
ldconfig
# configuration files.
 kern_securelevel_enable="NO"   # kernel security level (see security(7))
___
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...

svn commit: r367293 - head/usr.bin/calendar

2020-11-03 Thread Stefan Eßer
Author: se
Date: Tue Nov  3 12:15:08 2020
New Revision: 367293
URL: https://svnweb.freebsd.org/changeset/base/367293

Log:
  Consistently print calendar dates in the locale of the user
  
  Calendar files that specify LANG=... to specify their character encoding did
  also set the date format defined for that locale, resulting in output like:
  
  Nov  4Gabriel Faure dies from pneumonia in Paris, France, 1924
   4 nov.   N'oubliez pas les Charles !
  
  After this commit the output is always printed in a consistent format
  according to the user's current locale, e.g.:
  
  Nov  4Gabriel Faure dies from pneumonia in Paris, France, 1924
  Nov  4N'oubliez pas les Charles !
  
  I'll open a review asking for opinions whether this format change should
  be merged to -STABLE.
  
  Relnotes: yes

Modified:
  head/usr.bin/calendar/io.c

Modified: head/usr.bin/calendar/io.c
==
--- head/usr.bin/calendar/io.c  Tue Nov  3 11:37:19 2020(r367292)
+++ head/usr.bin/calendar/io.c  Tue Nov  3 12:15:08 2020(r367293)
@@ -468,8 +468,7 @@ cal_parse(FILE *in, FILE *out)
 * and does not run iconv(), this variable has little use.
 */
if (strncmp(buf, "LANG=", 5) == 0) {
-   (void)setlocale(LC_ALL, buf + 5);
-   d_first = (*nl_langinfo(D_MD_ORDER) == 'd');
+   (void)setlocale(LC_CTYPE, buf + 5);
 #ifdef WITH_ICONV
if (!doall)
set_new_encoding();
___
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: r367292 - head/usr.bin/calendar

2020-11-03 Thread Stefan Eßer
Author: se
Date: Tue Nov  3 11:37:19 2020
New Revision: 367292
URL: https://svnweb.freebsd.org/changeset/base/367292

Log:
  Check that #ifdef, #ifndef, and #undef are used with a single name
  
  This restores the parameter validation that has been peformed by cpp
  for defining and testing of names used in conditions.
  
  MFC after:3 days

Modified:
  head/usr.bin/calendar/io.c

Modified: head/usr.bin/calendar/io.c
==
--- head/usr.bin/calendar/io.c  Tue Nov  3 10:02:52 2020(r367291)
+++ head/usr.bin/calendar/io.c  Tue Nov  3 11:37:19 2020(r367292)
@@ -89,22 +89,29 @@ static StringList *definitions = NULL;
 static struct event *events[MAXCOUNT];
 static char *extradata[MAXCOUNT];
 
-static void
+static char *
 trimlr(char **buf)
 {
char *walk = *buf;
+   char *sep;
char *last;
 
while (isspace(*walk))
walk++;
-   if (*walk != '\0') {
-   last = walk + strlen(walk) - 1;
+   *buf = walk;
+
+   sep = walk;
+   while (*sep != '\0' && !isspace(*sep))
+   sep++;
+
+   if (*sep != '\0') {
+   last = sep + strlen(sep) - 1;
while (last > walk && isspace(*last))
last--;
*(last+1) = 0;
}
 
-   *buf = walk;
+   return (sep);
 }
 
 static FILE *
@@ -167,7 +174,7 @@ cal_path(void)
 static int
 token(char *line, FILE *out, int *skip, int *unskip)
 {
-   char *walk, c, a;
+   char *walk, *sep, a, c;
const char *this_cal_home;
const char *this_cal_dir;
const char *this_cal_file;
@@ -188,14 +195,20 @@ token(char *line, FILE *out, int *skip, int *unskip)
 
if (strncmp(line, "ifdef", 5) == 0) {
walk = line + 5;
-   trimlr(&walk);
+   sep = trimlr(&walk);
 
if (*walk == '\0') {
WARN0("Expecting arguments after #ifdef");
return (T_ERR);
}
+   if (*sep != '\0') {
+   WARN1("Expecting a single word after #ifdef "
+   "but got \"%s\"", walk);
+   return (T_ERR);
+   }
 
-   if (*skip != 0 || definitions == NULL || sl_find(definitions, 
walk) == NULL)
+   if (*skip != 0 ||
+   definitions == NULL || sl_find(definitions, walk) == NULL)
++*skip;
else
++*unskip;
@@ -205,14 +218,20 @@ token(char *line, FILE *out, int *skip, int *unskip)
 
if (strncmp(line, "ifndef", 6) == 0) {
walk = line + 6;
-   trimlr(&walk);
+   sep = trimlr(&walk);
 
if (*walk == '\0') {
WARN0("Expecting arguments after #ifndef");
return (T_ERR);
}
+   if (*sep != '\0') {
+   WARN1("Expecting a single word after #ifndef "
+   "but got \"%s\"", walk);
+   return (T_ERR);
+   }
 
-   if (*skip != 0 || (definitions != NULL && sl_find(definitions, 
walk) != NULL))
+   if (*skip != 0 ||
+   (definitions != NULL && sl_find(definitions, walk) != NULL))
++*skip;
else
++*unskip;
@@ -222,7 +241,7 @@ token(char *line, FILE *out, int *skip, int *unskip)
 
if (strncmp(line, "else", 4) == 0) {
walk = line + 4;
-   trimlr(&walk);
+   (void)trimlr(&walk);
 
if (*walk != '\0') {
WARN0("Expecting no arguments after #else");
@@ -251,7 +270,7 @@ token(char *line, FILE *out, int *skip, int *unskip)
if (strncmp(line, "include", 7) == 0) {
walk = line + 7;
 
-   trimlr(&walk);
+   (void)trimlr(&walk);
 
if (*walk == '\0') {
WARN0("Expecting arguments after #include");
@@ -291,7 +310,8 @@ token(char *line, FILE *out, int *skip, int *unskip)
if (definitions == NULL)
definitions = sl_init();
walk = line + 6;
-   trimlr(&walk);
+   sep = trimlr(&walk);
+   *sep = '\0';
 
if (*walk == '\0') {
WARN0("Expecting arguments after #define");
@@ -306,10 +326,15 @@ token(char *line, FILE *out, int *skip, int *unskip)
if (strncmp(line, "undef", 5) == 0) {
if (definitions != NULL) {
walk = line + 5;
-   trimlr(&walk);
+   sep = trimlr(&walk);
 
if (*walk == '\0') {
WARN0("Expecting arguments after #undef");
+  

Re: svn commit: r367280 - head/lib/libc/gen

2020-11-03 Thread Stefan Esser

   I think that the first question we want to ask is : Do we want to
support LOCALBASE being different than /usr/local


The big majority of users will keep the default value, and I do not
see a good reason for a change, except if there is a large installed
base that traditionally uses another prefix (I have seen /vol/local
and /opt, but also OS and architecture-specific prefixes, for example).


  I'd still like to see some arguments for such installs.


There are no reasons, if you have a narrow scope where FreeBSD should
get installed. If it only on individual desktop users' system, they
are best served with LOCALBASE immutably fixed to /usr/local.

But there are other kinds of user and I have already given examples.
Companies that have tooling that traditionally used some other prefix
will not rewrite all their tools if we tell them that only /usr/local
is supported, for example.

I do not have to justify the existence of such use cases, and I'm happy
with /usr/local on all my systems. But I do know that such use cases
do exist and I have worked in environments where they were relevant.


   I honestly don't see any advantages of making it !=/usr/local/ and
before we start putting a lot of new/useless(for I guess 99% of our
user base) in the tree we should here why people are using /usr/pkg or
whatever weird location.


No, why should we [assess] (assuming that word is to be implied in
your sentence) why people want to be able to easily use a different
prefix? That would be a waste of time, IMHO.

I know that there are legitimate reasons to want a different prefix,
and we had requests to make it easier to support it.


  What are thoses ?


Please check the mail-lists since I did not save those messages.


We have literal uses of /usr/local in a lot of files in the FreeBSD
base system (more than 1700) and this is not going to change.

But it was easy to replace a number of such literal pathes in base
system binaries, and we can make it easier for those that need a
different prefix to get it consistently used.


   If they have some good argument, then we should proceed further.


You do not have to participate in this effort


  I do have to participate, it's a common project.


But it does not affect you if you do not use it.


  Also since I also participate in pkg(8) and in ports/Mk lua/blah stuff
there might be some stuff to do there so yes I need to participate.


Ports should already support PREFIX and LOCALBASE other than /usr/local.

And the pkg program even supports the LOCALBASE environment variable.

All we try to do is go away from multiple inconsistent methods and
mechanisms and make it easier for installations that do have a need
for a different LOCALBASE to get in consistently applied to all parts
of the system. (They have to go through the tree and apply local
patches to program sources or config files, currently, but will then
have the same result with much more effort spent by each of them.)


  And since you never really started a conversation on a ml (that I know
of) my only mean to start this participation is answering a commit
email.


There has been a lengthy discussion in the thread about moving the
calendar data files out of the base system.

And there is review D26942, which was announced on the -current list
and which you seem to have missed. Also relevant are D27009, D27014,
and D27022, which have been mentioned in commits as far they have
already been committed, but have not been widely announced. You can
easily


- there are so many
other areas to work on (and I know you are very active in one).


  Only one ? Damn, I should work more then.


The most recent breakage you caused for me was the backlight kernel
option that has been introduced without any discussion I'm aware of.

Yes, I know about your involvement in getting support for modern GPUs
into FreeBSD and appreciate it.


But please do not ask those that have started to reduce the use of
literal /usr/local in the base system to justify this work.


  Seriously ? I have every right to ask you to justify this when it was
not talked about in a public forum.


What is the problem with replacing a literal string with a macro that
provides the exact same string to the compiler (unless its definition
in paths.h is changed).

Why are you against Scott Long suggesting a function getlocalbase()
that can be used as the official method to have a user supplied value
of LOCALBASE become effective in a program instead of local hacks
like checking for the LOCALBASE environment variable in some programs?

This does not affect you at all, since you can continue to hard-code
/usr/local or to continue to fetch LOCALBASE from the environment.

But developers that want to make sure that a non-default value of
LOCALBASE is consistently used by their software can make use of this
function instead of inventing their own.


If you are happy with /usr/local, then you are not affected at all.
And if you need to configure your system to use a

svn commit: r367291 - head/libexec/rc/rc.d

2020-11-03 Thread Mateusz Piotrowski
Author: 0mp (doc,ports committer)
Date: Tue Nov  3 10:02:52 2020
New Revision: 367291
URL: https://svnweb.freebsd.org/changeset/base/367291

Log:
  rc.d/zfs: Add shutdown to KEYWORDS
  
  The problem is that Without walling /etc/rc.d/zfs on shutdown, resources
  associated with ZFS mounts are not freed and the jails will remain in dying
  state. In addition, the dataset is now in a dangling state, as the jail it
  is attached to is dying.
  
  A known workaround for jails was to add the following lines
  to /etc/jail.conf, to make sure that "service zfs stop" is run
  when the jail is stopped:
  
  exec.stop = "/bin/sh /etc/rc.shutdown";
  exec.stop += "/usr/sbin/service zfs stop || /usr/bin/true";
  
  While the workaround seems to be okay-ish for the jail situation, it is
  still unclean. However, for physical hosts this may wreak havoc with the
  pool if shared spares are used, as "zfs unshare" is never invoked on
  shutdown.
  
  PR:   147444
  Submitted by: Markus Stoff 
  Reported by:  Mykah 
  Reviewed by:  cy
  Approved by:  cy (src)
  MFC after:1 week
  Relnotes: yes
  Differential Revision:https://reviews.freebsd.org/D27039

Modified:
  head/libexec/rc/rc.d/zfs

Modified: head/libexec/rc/rc.d/zfs
==
--- head/libexec/rc/rc.d/zfsTue Nov  3 02:10:54 2020(r367290)
+++ head/libexec/rc/rc.d/zfsTue Nov  3 10:02:52 2020(r367291)
@@ -6,6 +6,7 @@
 # PROVIDE: zfs
 # REQUIRE: zfsbe
 # BEFORE: FILESYSTEMS var
+# KEYWORD: shutdown
 
 . /etc/rc.subr
 
___
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"