Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Warner Losh
On Tue, Jun 16, 2020 at 9:53 PM Warner Losh  wrote:

>
>
> On Tue, Jun 16, 2020 at 8:33 PM Ian Lepore  wrote:
>
>> On Tue, 2020-06-16 at 19:34 +0200, Kristof Provost wrote:
>> > On 16 Jun 2020, at 19:11, Ed Maste wrote:
>> > > On Tue, 16 Jun 2020 at 13:01, Ian Lepore  wrote:
>> > > >
>> > > > As much as I prefer doing it this way, style(9) doesn't allow for
>> > > > variable declarations inside a for() statement (or even inside a
>> > > > local
>> > > > block, which is just too 1980s for me, but it is still our
>> standard).
>> > >
>> > > Perhaps it's time to update style(9) to at least permit these uses, as
>> > > we've done with the blank line at the beginning of functions with no
>> > > local variables, and with braces around single-line bodies.
>> >
>> > We have 431 instances of `for (int i` in sys alone. It’s not so much a
>> > question of allowing it as acknowledging reality at this point.
>> >
>> > Best regards,
>> > Kristof
>>
>> Hmm, so we do.  If you weed out sys/contrib, and device drivers
>> contributed by vendors, the number is a lot smaller, but still big
>> enough that we should just change the rules I think.
>>
>
> We should definitely just change the rules. There's no point in
> prohibiting it. Contributors have already voted with their feet
>
> diff --git a/share/man/man9/style.9 b/share/man/man9/style.9
> index 4e801bbcbe70..fd23d573eb00 100644
> --- a/share/man/man9/style.9
> +++ b/share/man/man9/style.9
> @@ -592,8 +592,6 @@ not
>  Parts of a
>  .Ic for
>  loop may be left empty.
> -Do not put declarations
> -inside blocks unless the routine is unusually complicated.
>  .Bd -literal
> for (; cnt < 15; cnt++) {
> stmt1;
>
> Though the block doesn't start until { so int i; in the commit technically
> doesn't violate this rule. We violate it in dozens of other ways than this.
>

Re-reading the thread, it seems there's a consensus to change.

https://reviews.freebsd.org/D25312


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


Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Warner Losh
On Tue, Jun 16, 2020 at 8:33 PM Ian Lepore  wrote:

> On Tue, 2020-06-16 at 19:34 +0200, Kristof Provost wrote:
> > On 16 Jun 2020, at 19:11, Ed Maste wrote:
> > > On Tue, 16 Jun 2020 at 13:01, Ian Lepore  wrote:
> > > >
> > > > As much as I prefer doing it this way, style(9) doesn't allow for
> > > > variable declarations inside a for() statement (or even inside a
> > > > local
> > > > block, which is just too 1980s for me, but it is still our standard).
> > >
> > > Perhaps it's time to update style(9) to at least permit these uses, as
> > > we've done with the blank line at the beginning of functions with no
> > > local variables, and with braces around single-line bodies.
> >
> > We have 431 instances of `for (int i` in sys alone. It’s not so much a
> > question of allowing it as acknowledging reality at this point.
> >
> > Best regards,
> > Kristof
>
> Hmm, so we do.  If you weed out sys/contrib, and device drivers
> contributed by vendors, the number is a lot smaller, but still big
> enough that we should just change the rules I think.
>

We should definitely just change the rules. There's no point in
prohibiting it. Contributors have already voted with their feet

diff --git a/share/man/man9/style.9 b/share/man/man9/style.9
index 4e801bbcbe70..fd23d573eb00 100644
--- a/share/man/man9/style.9
+++ b/share/man/man9/style.9
@@ -592,8 +592,6 @@ not
 Parts of a
 .Ic for
 loop may be left empty.
-Do not put declarations
-inside blocks unless the routine is unusually complicated.
 .Bd -literal
for (; cnt < 15; cnt++) {
stmt1;

Although the block doesn't start until { so int i; in the commit
technically doesn't violate this rule. We violate it in dozens of other
ways than this.

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


svn commit: r362257 - head/share/man/man4

2020-06-16 Thread Adrian Chadd
Author: adrian
Date: Wed Jun 17 03:16:20 2020
New Revision: 362257
URL: https://svnweb.freebsd.org/changeset/base/362257

Log:
  [ath] Mention DWDS, expresscard and minipcie.
  
  I use all of these..

Modified:
  head/share/man/man4/ath.4

Modified: head/share/man/man4/ath.4
==
--- head/share/man/man4/ath.4   Wed Jun 17 03:12:43 2020(r362256)
+++ head/share/man/man4/ath.4   Wed Jun 17 03:16:20 2020(r362257)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"/
-.Dd January 25, 2019
+.Dd June 16, 2020
 .Dt ATH 4
 .Os
 .Sh NAME
@@ -59,10 +59,10 @@ The
 driver provides support for wireless network adapters based on
 the Atheros AR5210, AR5211, AR5212, AR5416 and AR9300 programming APIs.
 These APIs are used by a wide variety of chips; most all chips with
-a PCI and/or CardBus interface are supported.
+a PCI, PCIe and/or CardBus interface are supported.
 .Pp
 Supported features include 802.11 and 802.3 frames, power management, BSS,
-IBSS, MBSS, TDMA, and host-based access point operation modes.
+IBSS, MBSS, WDS/DWDS TDMA, and host-based access point operation modes.
 All host/device interaction is via DMA.
 .Pp
 Please note that from FreeBSD-9.0, the
@@ -147,12 +147,13 @@ For more information on configuring this device, see
 .Pp
 Devices supported by the
 .Nm
-driver come in either Cardbus or mini-PCI packages.
-Wireless cards in Cardbus slots may be inserted and ejected on the fly.
+driver come in Cardbus, ExpressCard, Mini-PCI and Mini-PCIe packages.
+Wireless cards in Cardbus and ExpressCard slots may be inserted and
+ejected on the fly.
 .Sh HARDWARE
 The
 .Nm
-driver supports all Atheros Cardbus and PCI cards,
+driver supports all Atheros Cardbus, ExpressCard, PCI and PCIe cards,
 except those that are based on the AR5005VL chipset.
 .Sh EXAMPLES
 Join a specific BSS network with WEP encryption:
@@ -292,8 +293,7 @@ device driver first appeared in
 Revision A1 of the D-LINK DWL-G520 and DWL-G650 are based on an
 Intersil PrismGT chip and are not supported by this driver.
 .Sh BUGS
-The driver does not fully enable power-save operation of the chip
-in station mode; consequently power use is suboptimal (e.g. on a laptop).
+The driver does supports optional station mode power-save operation.
 .Pp
 The AR5210 can only do WEP in hardware; consequently hardware assisted WEP
 is disabled in order to allow software implementations of TKIP and CCMP to
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362256 - head/share/man/man4

2020-06-16 Thread Adrian Chadd
Author: adrian
Date: Wed Jun 17 03:12:43 2020
New Revision: 362256
URL: https://svnweb.freebsd.org/changeset/base/362256

Log:
  [run] mention that some 11n functionality is now available.
  
  A-MPDU, short-gi and 40MHz mode is currently not supported, but hey,
  it supports enough 11n to be useful.

Modified:
  head/share/man/man4/run.4

Modified: head/share/man/man4/run.4
==
--- head/share/man/man4/run.4   Wed Jun 17 01:11:47 2020(r362255)
+++ head/share/man/man4/run.4   Wed Jun 17 03:12:43 2020(r362256)
@@ -16,7 +16,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd November 8, 2018
+.Dd June 16, 2020
 .Dt RUN 4
 .Os
 .Sh NAME
@@ -251,5 +251,5 @@ driver was written by
 .Sh CAVEATS
 The
 .Nm
-driver does not support any of the 802.11n capabilities offered by the
+driver supports some of the 11n capabilities found in the
 RT2800, RT3000 and RT3900 chipsets.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Ian Lepore
On Tue, 2020-06-16 at 10:30 -0700, Rodney W. Grimes wrote:
> > In message <
> > 55903c38d363aef2a6f6d0075dd4526b86d51258.ca...@freebsd.org>, 
> > Ian Le
> > pore writes:
> > > On Tue, 2020-06-16 at 07:05 +, Toomas Soome wrote:
> > > > Author: tsoome
> > > > Date: Tue Jun 16 07:05:03 2020
> > > > New Revision: 362217
> > > > URL: https://svnweb.freebsd.org/changeset/base/362217
> > > > 
> > > > Log:
> > > >   loader: variable i is unused without MBR/GPT support built in
> > > >   
> > > >   Because i is only used as index in for loop, declare it in
> > > > for
> > > > statement.
> > > > 
> > > 
> > > As much as I prefer doing it this way, style(9) doesn't allow for
> > > variable declarations inside a for() statement (or even inside a
> > > local
> > > block, which is just too 1980s for me, but it is still our
> > > standard).
> 
> Last time I tried to assert that bit of style(9) with respect to
> inside a local block I was over ridden, so it is probably time
> to atleast revisit that part of style(9).
> 
> > Doesn't this use stack for a shorter period of time or does the
> > compiler 
> > optimize this, making this change moot?
> > 
> > The tradeoff is a few extra bytes of stack for a longer period of
> > time vs a 
> > few extra instructions incrementing and decrementing the stack
> > pointer.
> 
> I do not think the reasoning had to do with stack space vs
> instuctions,
> but more about being able to clearly know about variable reuse and
> not
> do it as that can create fun bugs.
> 
> Tools have modernized since that part of style was written.

I think a modern compiler will likely emit one of those "declaration of
foo here shadows declaration in outer scope" type messages.  Not that
it should; IMO, part of the point of keeping definitions confined to as
local a scope as possible is to help ensure you're using the variable
you think you are in that local scope and not accidentally perturbing
something used elsewhere.

-- Ian


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


Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Ian Lepore
On Tue, 2020-06-16 at 19:34 +0200, Kristof Provost wrote:
> On 16 Jun 2020, at 19:11, Ed Maste wrote:
> > On Tue, 16 Jun 2020 at 13:01, Ian Lepore  wrote:
> > > 
> > > As much as I prefer doing it this way, style(9) doesn't allow for
> > > variable declarations inside a for() statement (or even inside a 
> > > local
> > > block, which is just too 1980s for me, but it is still our standard).
> > 
> > Perhaps it's time to update style(9) to at least permit these uses, as
> > we've done with the blank line at the beginning of functions with no
> > local variables, and with braces around single-line bodies.
> 
> We have 431 instances of `for (int i` in sys alone. It’s not so much a 
> question of allowing it as acknowledging reality at this point.
> 
> Best regards,
> Kristof

Hmm, so we do.  If you weed out sys/contrib, and device drivers
contributed by vendors, the number is a lot smaller, but still big
enough that we should just change the rules I think.

-- Ian

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


svn commit: r362253 - head/sys/vm

2020-06-16 Thread Conrad Meyer
Author: cem
Date: Tue Jun 16 22:53:56 2020
New Revision: 362253
URL: https://svnweb.freebsd.org/changeset/base/362253

Log:
  vm: Drop vm_map_clip_{start,end} macro wrappers
  
  No functional change.
  
  Reviewed by:  dougm, markj
  Sponsored by: Dell EMC Isilon
  Differential Revision:https://reviews.freebsd.org/D25282

Modified:
  head/sys/vm/vm_map.c

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cTue Jun 16 21:30:30 2020(r362252)
+++ head/sys/vm/vm_map.cTue Jun 16 22:53:56 2020(r362253)
@@ -2377,24 +2377,17 @@ vm_map_entry_clone(vm_map_t map, vm_map_entry_t entry)
  * the specified address; if necessary,
  * it splits the entry into two.
  */
-#define vm_map_clip_start(map, entry, startaddr) \
-{ \
-   if (startaddr > entry->start) \
-   _vm_map_clip_start(map, entry, startaddr); \
-}
-
-/*
- * This routine is called only when it is known that
- * the entry must be split.
- */
 static inline void
-_vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start)
+vm_map_clip_start(vm_map_t map, vm_map_entry_t entry, vm_offset_t start)
 {
vm_map_entry_t new_entry;
 
+   if (start <= entry->start)
+   return;
+
VM_MAP_ASSERT_LOCKED(map);
KASSERT(entry->end > start && entry->start < start,
-   ("_vm_map_clip_start: invalid clip of entry %p", entry));
+   ("%s: invalid clip of entry %p", __func__, entry));
 
new_entry = vm_map_entry_clone(map, entry);
 
@@ -2435,24 +2428,17 @@ vm_map_lookup_clip_start(vm_map_t map, vm_offset_t sta
  * the specified address; if necessary,
  * it splits the entry into two.
  */
-#define vm_map_clip_end(map, entry, endaddr) \
-{ \
-   if ((endaddr) < (entry->end)) \
-   _vm_map_clip_end((map), (entry), (endaddr)); \
-}
-
-/*
- * This routine is called only when it is known that
- * the entry must be split.
- */
 static inline void
-_vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end)
+vm_map_clip_end(vm_map_t map, vm_map_entry_t entry, vm_offset_t end)
 {
vm_map_entry_t new_entry;
 
+   if (end >= entry->end)
+   return;
+
VM_MAP_ASSERT_LOCKED(map);
KASSERT(entry->start < end && entry->end > end,
-   ("_vm_map_clip_end: invalid clip of entry %p", entry));
+   ("%s: invalid clip of entry %p", __func__, entry));
 
new_entry = vm_map_entry_clone(map, entry);
 
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362252 - head/sys/kern

2020-06-16 Thread Ryan Moeller
Author: freqlabs
Date: Tue Jun 16 21:30:30 2020
New Revision: 362252
URL: https://svnweb.freebsd.org/changeset/base/362252

Log:
  Apply default security flavor in vfs_export
  
  There may be some version of mountd out there that does not supply a default
  security flavor when none is given for an export.
  
  Set the default security flavor in vfs_export if none is given, and remove the
  workaround for oexport compat.
  
  Reported by:  npn
  Reviewed by:  rmacklem
  Approved by:  mav (mentor)
  MFC after:3 days
  Sponsored by: iXsystems, Inc.
  Differential Revision:https://reviews.freebsd.org/D25300

Modified:
  head/sys/kern/vfs_export.c
  head/sys/kern/vfs_mount.c

Modified: head/sys/kern/vfs_export.c
==
--- head/sys/kern/vfs_export.c  Tue Jun 16 21:29:02 2020(r362251)
+++ head/sys/kern/vfs_export.c  Tue Jun 16 21:30:30 2020(r362252)
@@ -61,6 +61,9 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 
+#include 
+#include 
+
 static MALLOC_DEFINE(M_NETADDR, "export_host", "Export host address 
structure");
 
 #if defined(INET) || defined(INET6)
@@ -303,7 +306,7 @@ vfs_export(struct mount *mp, struct export_args *argp)
return (EINVAL);
 
if ((argp->ex_flags & MNT_EXPORTED) != 0 &&
-   (argp->ex_numsecflavors <= 0
+   (argp->ex_numsecflavors < 0
|| argp->ex_numsecflavors >= MAXSECFLAVORS))
return (EINVAL);
 
@@ -340,6 +343,10 @@ vfs_export(struct mount *mp, struct export_args *argp)
MNT_ILOCK(mp);
mp->mnt_flag |= MNT_EXPUBLIC;
MNT_IUNLOCK(mp);
+   }
+   if (argp->ex_numsecflavors == 0) {
+   argp->ex_numsecflavors = 1;
+   argp->ex_secflavors[0] = AUTH_SYS;
}
if ((error = vfs_hang_addrlist(mp, nep, argp)))
goto out;

Modified: head/sys/kern/vfs_mount.c
==
--- head/sys/kern/vfs_mount.c   Tue Jun 16 21:29:02 2020(r362251)
+++ head/sys/kern/vfs_mount.c   Tue Jun 16 21:30:30 2020(r362252)
@@ -70,9 +70,6 @@ __FBSDID("$FreeBSD$");
 
 #include 
 
-#include 
-#include 
-
 #include 
 #include 
 
@@ -1131,8 +1128,6 @@ vfs_domount_update(
switch (len) {
case (sizeof(struct oexport_args)):
bzero(, sizeof(o2export));
-   o2export.ex_numsecflavors = 1;
-   o2export.ex_secflavors[0] = AUTH_SYS;
/* FALLTHROUGH */
case (sizeof(o2export)):
bcopy(bufp, , len);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362251 - head/libexec/rtld-elf

2020-06-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jun 16 21:29:02 2020
New Revision: 362251
URL: https://svnweb.freebsd.org/changeset/base/362251

Log:
  rtld: Allow to load ET_DYN && DF_1_PIE when tracing.
  
  This makes old ldd to still work on newer tagged PIE binaries.
  
  Also move debug line for hashes before both decisions to not load are
  done, so that the end of digest_dynamic() processing and reason to not
  load or load is seen in debug trace.
  
  Noted by: jhb
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cTue Jun 16 21:25:58 2020
(r362250)
+++ head/libexec/rtld-elf/rtld.cTue Jun 16 21:29:02 2020
(r362251)
@@ -2612,12 +2612,13 @@ do_load_object(int fd, const char *name, char *path, s
 obj->path = path;
 if (!digest_dynamic(obj, 0))
goto errp;
-if (obj->z_pie) {
+dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path,
+   obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount);
+if (obj->z_pie && (flags & RTLD_LO_TRACE) == 0) {
+   dbg("refusing to load PIE executable \"%s\"", obj->path);
_rtld_error("Cannot load PIE binary %s as DSO", obj->path);
goto errp;
 }
-dbg("%s valid_hash_sysv %d valid_hash_gnu %d dynsymcount %d", obj->path,
-   obj->valid_hash_sysv, obj->valid_hash_gnu, obj->dynsymcount);
 if (obj->z_noopen && (flags & (RTLD_LO_DLOPEN | RTLD_LO_TRACE)) ==
   RTLD_LO_DLOPEN) {
dbg("refusing to load non-loadable \"%s\"", obj->path);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362246 - head/share/man/man9

2020-06-16 Thread Steffen Nurpmeso
Hello.

I seem to have nothing else to do but looking at trivial commits.
Sorry for that.

Rick Macklem wrote in
<202006162051.05gkpsyx065...@repo.freebsd.org>:
 |Author: rmacklem
 |Date: Tue Jun 16 20:51:28 2020
 |New Revision: 362246
 |URL: https://svnweb.freebsd.org/changeset/base/362246
 |
 |Log:
 |  Update VFS_CHECKEXP.9 for the argument changes done by r362158.
 ...
 |  This is a content change.
 ...
 |+++ head/share/man/man9/VFS_CHECKEXP.9Tue Jun 16 20:51:28 2020 \
 ...
 |-.Fn VFS_CHECKEXP "struct mount *mp" "struct sockaddr *nam" "int *exflag\
 |sp" "struct ucred **credanonp"
 |+.Fo VFS_CHECKEXP
 |+.Fa "struct mount *mp"
 |+.Fa "struct sockaddr *nam"
 |+.Fa "uint64_t *exflagsp"
 |+.Fa "struct ucred **credanonp"
 |+.Fa "int *numsecflavor"
 |+.Fa "int *secflavors"

.Fo needs .Fc.

 | .Sh DESCRIPTION

Ok .Sh resets it all, but .Fo opens and .Fc closes.
I currently deal with MusicBrainz data (since that single query
alone is not offered via JSON but only via XML, so then all and
only XML, yippieh), and i get for something like this

  not well-formed (invalid token) at line 2, column 2968, byte 3007 at 
/usr/lib/perl5/site_perl/5.28/linux-thread-multi/XML/Parser.pm line 187.

(Caused by a tmux mouse-selection copy and paste problem only,
everything all right.)  I wonder why mandoc lint does not catch
such things.  Don't you have git commit hooks which catch that.
I mean, i do not, but then i am not a professional ^_^

--steffen
|
|Der Kragenbaer,The moon bear,
|der holt sich munter   he cheerfully and one by one
|einen nach dem anderen runter  wa.ks himself off
|(By Robert Gernhardt)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362250 - head/libexec/rtld-elf

2020-06-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jun 16 21:25:58 2020
New Revision: 362250
URL: https://svnweb.freebsd.org/changeset/base/362250

Log:
  rtld: Add debug line for dlopen_object().
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cTue Jun 16 21:23:39 2020
(r362249)
+++ head/libexec/rtld-elf/rtld.cTue Jun 16 21:25:58 2020
(r362250)
@@ -3438,6 +3438,9 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref
 RtldLockState mlockstate;
 int result;
 
+dbg("dlopen_object name \"%s\" fd %d refobj \"%s\" lo_flags %#x mode %#x",
+  name != NULL ? name : "", fd, refobj == NULL ? "" :
+  refobj->path, lo_flags, mode);
 objlist_init();
 
 if (lockstate == NULL && !(lo_flags & RTLD_LO_EARLY)) {
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362249 - head/libexec/rtld-elf

2020-06-16 Thread Konstantin Belousov
Author: kib
Date: Tue Jun 16 21:23:39 2020
New Revision: 362249
URL: https://svnweb.freebsd.org/changeset/base/362249

Log:
  Systematically pass RTLD_LO_TRACE to load_needed_objects().
  
  Which makes all calls to load_object() to observe the flag, except the
  calls for preloaded DSOs.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/libexec/rtld-elf/rtld.c

Modified: head/libexec/rtld-elf/rtld.c
==
--- head/libexec/rtld-elf/rtld.cTue Jun 16 21:07:51 2020
(r362248)
+++ head/libexec/rtld-elf/rtld.cTue Jun 16 21:23:39 2020
(r362249)
@@ -721,7 +721,8 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entr
 preload_tail = globallist_curr(TAILQ_LAST(_list, obj_entry_q));
 
 dbg("loading needed objects");
-if (load_needed_objects(obj_main, 0) == -1)
+if (load_needed_objects(obj_main, ld_tracing != NULL ? RTLD_LO_TRACE :
+  0) == -1)
rtld_die();
 
 /* Make a list of all objects loaded at startup. */
@@ -3472,7 +3473,7 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref
}
if (result != -1)
result = load_needed_objects(obj, lo_flags & (RTLD_LO_DLOPEN |
-   RTLD_LO_EARLY | RTLD_LO_IGNSTLS));
+ RTLD_LO_EARLY | RTLD_LO_IGNSTLS | RTLD_LO_TRACE));
init_dag(obj);
ref_dag(obj);
if (result != -1)
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362248 - head/share/man/man9

2020-06-16 Thread Sergey Kandaurov
Author: pluknet
Date: Tue Jun 16 21:07:51 2020
New Revision: 362248
URL: https://svnweb.freebsd.org/changeset/base/362248

Log:
  Complete a function block with Fc, no content change.
  
  Notably, unbreaks rendering with groff.

Modified:
  head/share/man/man9/VFS_CHECKEXP.9

Modified: head/share/man/man9/VFS_CHECKEXP.9
==
--- head/share/man/man9/VFS_CHECKEXP.9  Tue Jun 16 20:55:22 2020
(r362247)
+++ head/share/man/man9/VFS_CHECKEXP.9  Tue Jun 16 21:07:51 2020
(r362248)
@@ -41,6 +41,7 @@
 .Fa "struct ucred **credanonp"
 .Fa "int *numsecflavor"
 .Fa "int *secflavors"
+.Fc
 .Sh DESCRIPTION
 The
 .Fn VFS_CHECKEXP
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362247 - head

2020-06-16 Thread Rick Macklem
Author: rmacklem
Date: Tue Jun 16 20:55:22 2020
New Revision: 362247
URL: https://svnweb.freebsd.org/changeset/base/362247

Log:
  Add an entry for r362158, r362163, which changes struct export_args.

Modified:
  head/RELNOTES

Modified: head/RELNOTES
==
--- head/RELNOTES   Tue Jun 16 20:51:28 2020(r362246)
+++ head/RELNOTES   Tue Jun 16 20:55:22 2020(r362247)
@@ -10,6 +10,11 @@ newline.  Entries should be separated by a newline.
 
 Changes to this file should not be MFCed.
 
+r362158, r362163:
+   struct export_args has changed so that the "user" specified for
+   the -maproot and -mapall exports(5) options may be in more than
+   16 groups.
+
 r361884:
sed(1) has learned about hex escapes (e.g. \x27) and will now do the
right thing with them, removing the need for printf magic or obnoxious
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362246 - head/share/man/man9

2020-06-16 Thread Rick Macklem
Author: rmacklem
Date: Tue Jun 16 20:51:28 2020
New Revision: 362246
URL: https://svnweb.freebsd.org/changeset/base/362246

Log:
  Update VFS_CHECKEXP.9 for the argument changes done by r362158.
  
  The arguments for VFS_CHECKEXP() were changed by r362158.
  Also, the numsecflavors and secflavors arguments were not documented,
  so add these as well.
  
  This is a content change.

Modified:
  head/share/man/man9/VFS_CHECKEXP.9

Modified: head/share/man/man9/VFS_CHECKEXP.9
==
--- head/share/man/man9/VFS_CHECKEXP.9  Tue Jun 16 20:44:51 2020
(r362245)
+++ head/share/man/man9/VFS_CHECKEXP.9  Tue Jun 16 20:51:28 2020
(r362246)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd January 4, 2010
+.Dd June 16, 2020
 .Dt VFS_CHECKEXP 9
 .Os
 .Sh NAME
@@ -34,7 +34,13 @@
 .In sys/param.h
 .In sys/mount.h
 .Ft int
-.Fn VFS_CHECKEXP "struct mount *mp" "struct sockaddr *nam" "int *exflagsp" 
"struct ucred **credanonp"
+.Fo VFS_CHECKEXP
+.Fa "struct mount *mp"
+.Fa "struct sockaddr *nam"
+.Fa "uint64_t *exflagsp"
+.Fa "struct ucred **credanonp"
+.Fa "int *numsecflavor"
+.Fa "int *secflavors"
 .Sh DESCRIPTION
 The
 .Fn VFS_CHECKEXP
@@ -51,6 +57,11 @@ An mbuf containing the network address of the client.
 Return parameter for the export flags for this client.
 .It Fa credanonp
 Return parameter for the anonymous credentials for this client.
+.It Fa numsecflavors
+Return value for the number of security flavors for this client.
+.It Fa secflavors
+Must be an array of size MAXSECFLAVORS, in which the security flavors
+for this client are returned.
 .El
 .Pp
 The
@@ -71,13 +82,15 @@ structure and the address of the client,
 .Fa nam ,
 to verify that the client can access this file system.
 .Sh RETURN VALUES
-The export flags and anonymous credentials specific to the client (returned
-by
+The export flags, anonymous credentials and security flavors specific to the
+client (returned by
 .Xr vfs_export_lookup 9 )
 will be returned in
-.Fa *exflagsp
+.Fa *exflagsp ,
+.Fa *credanonp ,
+.Fa *numsecflavors
 and
-.Fa *credanonp .
+.Fa *secflavors .
 .Sh SEE ALSO
 .Xr VFS 9 ,
 .Xr VFS_FHTOVP 9 ,
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362239 - head/stand/i386/common

2020-06-16 Thread Toomas Soome
Author: tsoome
Date: Tue Jun 16 20:35:00 2020
New Revision: 362239
URL: https://svnweb.freebsd.org/changeset/base/362239

Log:
  boot2: need to expand tab output and mask getchar
  
  The BIOS ouput char function does not expand tab.
  Mask getchar with 0xFF.
  
  Sponsored by: Netflix, Klara Inc.

Modified:
  head/stand/i386/common/cons.c

Modified: head/stand/i386/common/cons.c
==
--- head/stand/i386/common/cons.c   Tue Jun 16 20:23:57 2020
(r362238)
+++ head/stand/i386/common/cons.c   Tue Jun 16 20:35:00 2020
(r362239)
@@ -53,12 +53,38 @@ xputc(int c)
sio_putc(c);
 }
 
+static void
+getcursor(int *row, int *col)
+{
+   v86.ctl = V86_FLAGS;
+   v86.addr = 0x10;
+   v86.eax = 0x300;
+   v86.ebx = 0x7;
+   v86int();
+
+   if (row != NULL)
+   *row = v86.edx >> 8;
+   if (col != NULL)
+   *col = v86.edx & 0xff;
+}
+
 void
 putchar(int c)
 {
+   int i, col;
 
-   if (c == '\n')
+   switch (c) {
+   case '\n':
xputc('\r');
+   break;
+   case '\t':
+   col = 0;
+   getcursor(NULL, );
+   col = 8 - (col % 8);
+   for (i = 0; i < col; i++)
+   xputc(' ');
+   return;
+   }
xputc(c);
 }
 
@@ -100,7 +126,7 @@ int
 getchar(void)
 {
 
-   return (xgetc(0));
+   return (xgetc(0) & 0xff);
 }
 
 int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362236 - head/usr.sbin/mpsutil

2020-06-16 Thread Juli Mallett
Author: jmallett
Date: Tue Jun 16 19:21:28 2020
New Revision: 362236
URL: https://svnweb.freebsd.org/changeset/base/362236

Log:
  Improve unit parsing of mpsutil.
  
  Previously, it used atoi(3) to parse the unit parameter, which would silently
  yield a unit of 0 in the presence of an invalid unit number.  As most users of
  mpsutil(8) are likely to have at least a unit 0, this is could have confusing
  results.
  
  This behaviour was particularly unintuitive if one incorrectly passed an
  adapter device name, or a device path, instead of a unit number.  In addition
  to using strtoumax(3) instead of atoi(3) to parse unit numbers, support
  stripping a device name (e.g. mps1) or path (e.g. /dev/mps2) to just its unit
  number.
  
  Reviewed by:  scottl (earlier version)

Modified:
  head/usr.sbin/mpsutil/mpsutil.c

Modified: head/usr.sbin/mpsutil/mpsutil.c
==
--- head/usr.sbin/mpsutil/mpsutil.c Tue Jun 16 18:39:56 2020
(r362235)
+++ head/usr.sbin/mpsutil/mpsutil.c Tue Jun 16 19:21:28 2020
(r362236)
@@ -37,6 +37,8 @@ __RCSID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -91,6 +93,8 @@ int
 main(int ac, char **av)
 {
struct mpsutil_command **cmd;
+   uintmax_t unit;
+   char *end;
int ch;
 
is_mps = !strcmp(getprogname(), "mpsutil");
@@ -98,7 +102,17 @@ main(int ac, char **av)
while ((ch = getopt(ac, av, "u:h?")) != -1) {
switch (ch) {
case 'u':
-   mps_unit = atoi(optarg);
+   if (strncmp(optarg, _PATH_DEV, strlen(_PATH_DEV)) == 0) 
{
+   optarg += strlen(_PATH_DEV);
+   if (strncmp(optarg, is_mps ? "mps" : "mpr", 3) 
!= 0)
+   errx(1, "Invalid device: %s", optarg);
+   }
+   if (strncmp(optarg, is_mps ? "mps" : "mpr", 3) == 0)
+   optarg += 3;
+   unit = strtoumax(optarg, , 10);
+   if (*end != '\0' || unit == UINTMAX_MAX || unit > 
INT_MAX)
+   errx(1, "Invalid unit: %s", optarg);
+   mps_unit = unit;
break;
case 'h':
case '?':
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362235 - head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch

2020-06-16 Thread Kristof Provost
Author: kp
Date: Tue Jun 16 18:39:56 2020
New Revision: 362235
URL: https://svnweb.freebsd.org/changeset/base/362235

Log:
  llvm: Default to -mno-relax on RISC-V
  
  Compiling on a RISC-V system fails with 'relocation R_RISCV_ALIGN
  requires unimplemented linker relaxation; recompile with -mno-relax'.
  
  Our default linker (ld.lld) doesn't support relaxation, so default to
  no-relax so we don't generate object files the linker can't handle.
  
  Reviewed by:  mhorne
  Sponsored by: Axiado
  Differential Revision:https://reviews.freebsd.org/D25210

Modified:
  head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp

Modified: head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
==
--- head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
Tue Jun 16 18:16:45 2020(r362234)
+++ head/contrib/llvm-project/clang/lib/Driver/ToolChains/Arch/RISCV.cpp
Tue Jun 16 18:39:56 2020(r362235)
@@ -426,8 +426,9 @@ void riscv::getRISCVTargetFeatures(const Driver , co
   if (Args.hasArg(options::OPT_ffixed_x31))
 Features.push_back("+reserve-x31");
 
-  // -mrelax is default, unless -mno-relax is specified.
-  if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, true))
+  // FreeBSD local, because ld.lld doesn't support relaxations
+  // -mno-relax is default, unless -mrelax is specified.
+  if (Args.hasFlag(options::OPT_mrelax, options::OPT_mno_relax, false))
 Features.push_back("+relax");
   else
 Features.push_back("-relax");
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362234 - head/sys/netinet/tcp_stacks

2020-06-16 Thread Randall Stewart
Author: rrs
Date: Tue Jun 16 18:16:45 2020
New Revision: 362234
URL: https://svnweb.freebsd.org/changeset/base/362234

Log:
  iSo in doing final checks on OCA firmware with all the latest tweaks the 
dup-ack checking
  packet drill script was failing with a number of unexpected acks. So it turns
  out if you have the default recvwin set up to 1Meg (like OCA's do) and you
  have no window scaling (like the dupack checking code) then we have another
  case where we are always trying to update the rwnd and sending an
  ack when we should not.
  
  Sponsored by: Netflix Inc.
  Differential Revision:https://reviews.freebsd.org/D25298

Modified:
  head/sys/netinet/tcp_stacks/bbr.c
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_stacks/bbr.c
==
--- head/sys/netinet/tcp_stacks/bbr.c   Tue Jun 16 17:45:23 2020
(r362233)
+++ head/sys/netinet/tcp_stacks/bbr.c   Tue Jun 16 18:16:45 2020
(r362234)
@@ -12157,8 +12157,8 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva
 * have gotten more data into the socket buffer to
 * send.
 */
-   recwin = min(max(sbspace(>so_rcv), 0),
-   TCP_MAXWIN << tp->rcv_scale);
+   recwin = lmin(lmax(sbspace(>so_rcv), 0),
+ (long)TCP_MAXWIN << tp->rcv_scale);
if ((bbr_window_update_needed(tp, so, recwin, maxseg) 
== 0) &&
((tcp_outflags[tp->t_state] & TH_RST) == 0) &&
((sbavail(sb) + ((tcp_outflags[tp->t_state] & 
TH_FIN) ? 1 : 0)) <=
@@ -12839,8 +12839,8 @@ recheck_resend:
ipoptlen == 0)
tso = 1;
 
-   recwin = min(max(sbspace(>so_rcv), 0),
-   TCP_MAXWIN << tp->rcv_scale);
+   recwin = lmin(lmax(sbspace(>so_rcv), 0),
+   (long)TCP_MAXWIN << tp->rcv_scale);
/*
 * Sender silly window avoidance.   We transmit under the following
 * conditions when len is non-zero:

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Tue Jun 16 17:45:23 2020
(r362233)
+++ head/sys/netinet/tcp_stacks/rack.c  Tue Jun 16 18:16:45 2020
(r362234)
@@ -12750,7 +12750,8 @@ again:
flags &= ~TH_FIN;
}
}
-   recwin = sbspace(>so_rcv);
+   recwin = lmin(lmax(sbspace(>so_rcv), 0),
+   (long)TCP_MAXWIN << tp->rcv_scale);
 
/*
 * Sender silly window avoidance.   We transmit under the following
@@ -13656,8 +13657,6 @@ send:
if (SEQ_GT(tp->rcv_adv, tp->rcv_nxt) &&
recwin < (long)(tp->rcv_adv - tp->rcv_nxt))
recwin = (long)(tp->rcv_adv - tp->rcv_nxt);
-   if (recwin > (long)TCP_MAXWIN << tp->rcv_scale)
-   recwin = (long)TCP_MAXWIN << tp->rcv_scale;
}
 
/*
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362233 - head/usr.sbin/newsyslog

2020-06-16 Thread Eugene Grosbein
Author: eugen
Date: Tue Jun 16 17:45:23 2020
New Revision: 362233
URL: https://svnweb.freebsd.org/changeset/base/362233

Log:
  newsyslog(8): make configuration parser more robust.
  
  Currently newsyslog supports  directive that is used
  in our default /etc/newsyslog.conf in the following form:
  
   /usr/local/etc/newsyslog.conf.d/*
  
  While this is suitable for ports installing their own rules
  for logs rotation, this also makes newsyslog break entire
  processing of all files if it encounters single line it cannot parse.
  This includes lines referring to nonexistent username/group for log
  ownership, so newsyslog stops calling errx() function in the parser.
  
  With this fix, newsyslog uses warnx() instead of errx() in such cases
  to print a warning, recover gracefully and continue with execution.
  
  Among other cases, this unbreaks initial creation of log files
  having flag "C" at boot time (newsyslog -CN). This is most important
  for systems having RAM-based /var file system like nanobsd(8)-based
  that rely on newsyslog to bring system log files into existence.
  
  MFC after:1 month

Modified:
  head/usr.sbin/newsyslog/newsyslog.c

Modified: head/usr.sbin/newsyslog/newsyslog.c
==
--- head/usr.sbin/newsyslog/newsyslog.c Tue Jun 16 17:05:38 2020
(r362232)
+++ head/usr.sbin/newsyslog/newsyslog.c Tue Jun 16 17:45:23 2020
(r362233)
@@ -1078,9 +1078,11 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl
 
q = parse = missing_field(sob(line), errline);
parse = son(line);
-   if (!*parse)
-   errx(1, "malformed line (missing fields):\n%s",
+   if (!*parse) {
+   warnx("malformed line (missing fields):\n%s",
errline);
+   continue;
+   }
*parse = '\0';
 
/*
@@ -1132,22 +1134,24 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl
continue;
}
 
+#define badline(msg, ...) do { \
+   warnx(msg, __VA_ARGS__);\
+   goto cleanup;   \
+} while (0)
+
special = 0;
working = init_entry(q, NULL);
if (strcasecmp(DEFAULT_MARKER, q) == 0) {
special = 1;
-   if (*defconf_p != NULL) {
-   warnx("Ignoring duplicate entry for %s!", q);
-   free_entry(working);
-   continue;
-   }
+   if (*defconf_p != NULL)
+   badline("Ignoring duplicate entry for %s!", q);
*defconf_p = working;
}
 
q = parse = missing_field(sob(parse + 1), errline);
parse = son(parse);
if (!*parse)
-   errx(1, "malformed line (missing fields):\n%s",
+   badline("malformed line (missing fields):\n%s",
errline);
*parse = '\0';
if ((group = strchr(q, ':')) != NULL ||
@@ -1156,7 +1160,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl
if (*q) {
if (!(isnumberstr(q))) {
if ((pwd = getpwnam(q)) == NULL)
-   errx(1,
+   badline(
 "error in config file; unknown user:\n%s",
errline);
working->uid = pwd->pw_uid;
@@ -1169,7 +1173,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl
if (*q) {
if (!(isnumberstr(q))) {
if ((grp = getgrnam(q)) == NULL)
-   errx(1,
+   badline(
"error in config file; unknown group:\n%s",
errline);
working->gid = grp->gr_gid;
@@ -1181,7 +1185,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl
q = parse = missing_field(sob(parse + 1), errline);
parse = son(parse);
if (!*parse)
-   errx(1, "malformed line (missing fields):\n%s",
+   badline("malformed line (missing fields):\n%s",
errline);
*parse = '\0';
} else {
@@ -1190,7 +1194,7 @@ parse_file(FILE *cf, struct cflist *work_p, struct cfl

Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Kristof Provost

On 16 Jun 2020, at 19:11, Ed Maste wrote:

On Tue, 16 Jun 2020 at 13:01, Ian Lepore  wrote:


As much as I prefer doing it this way, style(9) doesn't allow for
variable declarations inside a for() statement (or even inside a 
local

block, which is just too 1980s for me, but it is still our standard).


Perhaps it's time to update style(9) to at least permit these uses, as
we've done with the blank line at the beginning of functions with no
local variables, and with braces around single-line bodies.


We have 431 instances of `for (int i` in sys alone. It’s not so much a 
question of allowing it as acknowledging reality at this point.


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


Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Rodney W. Grimes
> In message <55903c38d363aef2a6f6d0075dd4526b86d51258.ca...@freebsd.org>, 
> Ian Le
> pore writes:
> > On Tue, 2020-06-16 at 07:05 +, Toomas Soome wrote:
> > > Author: tsoome
> > > Date: Tue Jun 16 07:05:03 2020
> > > New Revision: 362217
> > > URL: https://svnweb.freebsd.org/changeset/base/362217
> > > 
> > > Log:
> > >   loader: variable i is unused without MBR/GPT support built in
> > >   
> > >   Because i is only used as index in for loop, declare it in for
> > > statement.
> > > 
> >
> > As much as I prefer doing it this way, style(9) doesn't allow for
> > variable declarations inside a for() statement (or even inside a local
> > block, which is just too 1980s for me, but it is still our standard).

Last time I tried to assert that bit of style(9) with respect to
inside a local block I was over ridden, so it is probably time
to atleast revisit that part of style(9).

> Doesn't this use stack for a shorter period of time or does the compiler 
> optimize this, making this change moot?
> 
> The tradeoff is a few extra bytes of stack for a longer period of time vs a 
> few extra instructions incrementing and decrementing the stack pointer.

I do not think the reasoning had to do with stack space vs instuctions,
but more about being able to clearly know about variable reuse and not
do it as that can create fun bugs.

Tools have modernized since that part of style was written.

> -- 
> Cy Schubert 
-- 
Rod Grimes rgri...@freebsd.org
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Pedro Giffuni



On 16/06/2020 12:01, Ian Lepore wrote:

On Tue, 2020-06-16 at 07:05 +, Toomas Soome wrote:

Author: tsoome
Date: Tue Jun 16 07:05:03 2020
New Revision: 362217
URL: https://svnweb.freebsd.org/changeset/base/362217

Log:
   loader: variable i is unused without MBR/GPT support built in
   
   Because i is only used as index in for loop, declare it in for

statement.


As much as I prefer doing it this way, style(9) doesn't allow for
variable declarations inside a for() statement (or even inside a local
block, which is just too 1980s for me, but it is still our standard).


Perhaps style(9) needs updating? I think KNF is mandatory for kernel 
code only, and is only suggested for userland.


Pedro.

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


Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Ed Maste
On Tue, 16 Jun 2020 at 13:01, Ian Lepore  wrote:
>
> As much as I prefer doing it this way, style(9) doesn't allow for
> variable declarations inside a for() statement (or even inside a local
> block, which is just too 1980s for me, but it is still our standard).

Perhaps it's time to update style(9) to at least permit these uses, as
we've done with the blank line at the beginning of functions with no
local variables, and with braces around single-line bodies.
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Cy Schubert
In message <55903c38d363aef2a6f6d0075dd4526b86d51258.ca...@freebsd.org>, 
Ian Le
pore writes:
> On Tue, 2020-06-16 at 07:05 +, Toomas Soome wrote:
> > Author: tsoome
> > Date: Tue Jun 16 07:05:03 2020
> > New Revision: 362217
> > URL: https://svnweb.freebsd.org/changeset/base/362217
> > 
> > Log:
> >   loader: variable i is unused without MBR/GPT support built in
> >   
> >   Because i is only used as index in for loop, declare it in for
> > statement.
> > 
>
> As much as I prefer doing it this way, style(9) doesn't allow for
> variable declarations inside a for() statement (or even inside a local
> block, which is just too 1980s for me, but it is still our standard).

Doesn't this use stack for a shorter period of time or does the compiler 
optimize this, making this change moot?

The tradeoff is a few extra bytes of stack for a longer period of time vs a 
few extra instructions incrementing and decrementing the stack pointer.


-- 
Cheers,
Cy Schubert 
FreeBSD UNIX: Web:  https://FreeBSD.org
NTP:   Web:  https://nwtime.org

The need of the many outweighs the greed of the few.


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


svn commit: r362232 - head/lib/libc/gen

2020-06-16 Thread Marc Fonvieille
Author: blackend (doc committer)
Date: Tue Jun 16 17:05:38 2020
New Revision: 362232
URL: https://svnweb.freebsd.org/changeset/base/362232

Log:
  Fix pointer name to match the name used in the function prototype
  above (and in termios.c).
  
  Discussed with:   Rodney W. Grimes 

Modified:
  head/lib/libc/gen/tcsetattr.3

Modified: head/lib/libc/gen/tcsetattr.3
==
--- head/lib/libc/gen/tcsetattr.3   Tue Jun 16 17:02:56 2020
(r362231)
+++ head/lib/libc/gen/tcsetattr.3   Tue Jun 16 17:05:38 2020
(r362232)
@@ -126,24 +126,24 @@ represented, however, the following symbolic values ar
 The
 .Fn cfgetispeed
 function returns the input baud rate in the termios structure referenced by
-.Fa tp .
+.Fa t .
 .Pp
 The
 .Fn cfsetispeed
 function sets the input baud rate in the termios structure referenced by
-.Fa tp
+.Fa t
 to
 .Fa speed .
 .Pp
 The
 .Fn cfgetospeed
 function returns the output baud rate in the termios structure referenced by
-.Fa tp .
+.Fa t .
 .Pp
 The
 .Fn cfsetospeed
 function sets the output baud rate in the termios structure referenced by
-.Fa tp
+.Fa t
 to
 .Fa speed .
 .Pp
@@ -151,7 +151,7 @@ The
 .Fn cfsetspeed
 function sets both the input and output baud rate in the termios structure
 referenced by
-.Fa tp
+.Fa t
 to
 .Fa speed .
 .Pp
@@ -210,7 +210,7 @@ function copies the parameters associated with the ter
 by
 .Fa fd
 in the termios structure referenced by
-.Fa tp .
+.Fa t .
 This function is allowed from a background process, however, the terminal
 attributes may be subsequently changed by a foreground process.
 .Pp
@@ -218,7 +218,7 @@ The
 .Fn tcsetattr
 function sets the parameters associated with the terminal from the
 termios structure referenced by
-.Fa tp .
+.Fa t .
 The
 .Fa action
 argument is created by
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362231 - head/sys/kern

2020-06-16 Thread Simon J. Gerraty
Author: sjg
Date: Tue Jun 16 17:02:56 2020
New Revision: 362231
URL: https://svnweb.freebsd.org/changeset/base/362231

Log:
  Make KENV_MVALLEN tunable
  
  When doing secure boot, loader wants to export loader.ve.hashed
  the value of which typically exceeds KENV_MVALLEN.
  
  Replace use of KENV_MVALLEN with tunable kenv_mvallen.
  
  Add getenv_string_buffer() for the case where a stack buffer cannot be
  created and use uma_zone_t kenv_zone for suitably sized buffers.
  
  Reviewed by:  stevek, kevans
  Obtained from:Abhishek Kulkarni 
  MFC after:1 week
  Sponsored by: Juniper Networks
  Differential Revision: https://reviews.freebsd.org//D25259

Modified:
  head/sys/kern/kern_environment.c

Modified: head/sys/kern/kern_environment.c
==
--- head/sys/kern/kern_environment.cTue Jun 16 16:48:52 2020
(r362230)
+++ head/sys/kern/kern_environment.cTue Jun 16 17:02:56 2020
(r362231)
@@ -63,6 +63,9 @@ static MALLOC_DEFINE(M_KENV, "kenv", "kernel environme
 
 #define KENV_SIZE  512 /* Maximum number of environment strings */
 
+static uma_zone_t kenv_zone;
+static int kenv_mvallen = KENV_MVALLEN;
+
 /* pointer to the config-generated static environment */
 char   *kern_envp;
 
@@ -85,6 +88,8 @@ bool  dynamic_kenv;
 #define KENV_CHECK if (!dynamic_kenv) \
panic("%s: called before SI_SUB_KMEM", __func__)
 
+static char*getenv_string_buffer(const char *);
+
 int
 sys_kenv(td, uap)
struct thread *td;
@@ -110,9 +115,9 @@ sys_kenv(td, uap)
 #endif
done = needed = 0;
buflen = uap->len;
-   if (buflen > KENV_SIZE * (KENV_MNAMELEN + KENV_MVALLEN + 2))
+   if (buflen > KENV_SIZE * (KENV_MNAMELEN + kenv_mvallen + 2))
buflen = KENV_SIZE * (KENV_MNAMELEN +
-   KENV_MVALLEN + 2);
+   kenv_mvallen + 2);
if (uap->len > 0 && uap->value != NULL)
buffer = malloc(buflen, M_TEMP, M_WAITOK|M_ZERO);
mtx_lock(_lock);
@@ -185,8 +190,8 @@ sys_kenv(td, uap)
error = EINVAL;
goto done;
}
-   if (len > KENV_MVALLEN + 1)
-   len = KENV_MVALLEN + 1;
+   if (len > kenv_mvallen + 1)
+   len = kenv_mvallen + 1;
value = malloc(len, M_TEMP, M_WAITOK);
error = copyinstr(uap->value, value, len, NULL);
if (error) {
@@ -327,7 +332,7 @@ init_dynamic_kenv_from(char *init_env, int *curpos)
for (cp = init_env; cp != NULL; cp = cpnext) {
cpnext = kernenv_next(cp);
len = strlen(cp) + 1;
-   if (len > KENV_MNAMELEN + 1 + KENV_MVALLEN + 1) {
+   if (len > KENV_MNAMELEN + 1 + kenv_mvallen + 1) {
printf(
"WARNING: too long kenv string, ignoring %s\n",
cp);
@@ -375,7 +380,14 @@ static void
 init_dynamic_kenv(void *data __unused)
 {
int dynamic_envpos;
+   int size;
 
+   TUNABLE_INT_FETCH("kenv_mvallen", _mvallen);
+   size = KENV_MNAMELEN + 1 + kenv_mvallen + 1;
+
+   kenv_zone = uma_zcreate("kenv", size, NULL, NULL, NULL, NULL,
+   UMA_ALIGN_PTR, 0);
+
kenvp = malloc((KENV_SIZE + 1) * sizeof(char *), M_KENV,
M_WAITOK | M_ZERO);
 
@@ -395,7 +407,7 @@ freeenv(char *env)
 
if (dynamic_kenv && env != NULL) {
explicit_bzero(env, strlen(env));
-   free(env, M_KENV);
+   uma_zfree(kenv_zone, env);
}
 }
 
@@ -470,14 +482,11 @@ _getenv_static(const char *name)
 char *
 kern_getenv(const char *name)
 {
-   char buf[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1];
char *ret;
 
if (dynamic_kenv) {
-   if (getenv_string(name, buf, sizeof(buf))) {
-   ret = strdup(buf, M_KENV);
-   } else {
-   ret = NULL;
+   ret = getenv_string_buffer(name);
+   if (ret == NULL) {
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL,
"getenv");
}
@@ -548,7 +557,7 @@ kern_setenv(const char *name, const char *value)
if (namelen > KENV_MNAMELEN + 1)
return (-1);
vallen = strlen(value) + 1;
-   if (vallen > KENV_MVALLEN + 1)
+   if (vallen > kenv_mvallen + 1)
return (-1);
buf = malloc(namelen + vallen, M_KENV, M_WAITOK);
sprintf(buf, "%s=%s", name, value);
@@ -607,6 +616,33 @@ kern_unsetenv(const char *name)
 }
 
 /*
+ * Return a buffer containing the string value from an environment variable
+ */
+static char *

Re: svn commit: r362217 - head/stand/common

2020-06-16 Thread Ian Lepore
On Tue, 2020-06-16 at 07:05 +, Toomas Soome wrote:
> Author: tsoome
> Date: Tue Jun 16 07:05:03 2020
> New Revision: 362217
> URL: https://svnweb.freebsd.org/changeset/base/362217
> 
> Log:
>   loader: variable i is unused without MBR/GPT support built in
>   
>   Because i is only used as index in for loop, declare it in for
> statement.
> 

As much as I prefer doing it this way, style(9) doesn't allow for
variable declarations inside a for() statement (or even inside a local
block, which is just too 1980s for me, but it is still our standard).

-- Ian

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


svn commit: r362230 - in head/lib: libc/capability libc/gen libc/sys libcasper/libcasper libcasper/services/cap_dns libcasper/services/cap_fileargs libcasper/services/cap_grp libcasper/services/cap...

2020-06-16 Thread Gordon Bergling
Author: gbe (doc committer)
Date: Tue Jun 16 16:48:52 2020
New Revision: 362230
URL: https://svnweb.freebsd.org/changeset/base/362230

Log:
  libcasper(3): Document HISTORY within the manpages
  
  Reviewed by:  bcr (mentor)
  Approved by:  bcr (mentor)
  MFC after:7 days
  Differential Revision:https://reviews.freebsd.org/D24695

Modified:
  head/lib/libc/capability/cap_rights_init.3
  head/lib/libc/gen/cap_rights_get.3
  head/lib/libc/gen/cap_sandboxed.3
  head/lib/libc/sys/cap_enter.2
  head/lib/libc/sys/cap_fcntls_limit.2
  head/lib/libc/sys/cap_ioctls_limit.2
  head/lib/libc/sys/cap_rights_limit.2
  head/lib/libcasper/libcasper/libcasper.3
  head/lib/libcasper/libcasper/libcasper_service.3
  head/lib/libcasper/services/cap_dns/cap_dns.3
  head/lib/libcasper/services/cap_fileargs/cap_fileargs.3
  head/lib/libcasper/services/cap_grp/cap_grp.3
  head/lib/libcasper/services/cap_pwd/cap_pwd.3
  head/lib/libcasper/services/cap_sysctl/cap_sysctl.3
  head/lib/libcasper/services/cap_syslog/cap_syslog.3

Modified: head/lib/libc/capability/cap_rights_init.3
==
--- head/lib/libc/capability/cap_rights_init.3  Tue Jun 16 15:54:59 2020
(r362229)
+++ head/lib/libc/capability/cap_rights_init.3  Tue Jun 16 16:48:52 2020
(r362230)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2014
+.Dd May 5, 2020
 .Dt CAP_RIGHTS_INIT 3
 .Os
 .Sh NAME
@@ -232,6 +232,18 @@ if (cap_rights_limit(fd, ) < 0 && errno != ENOS
 .Xr capsicum 4 ,
 .Xr rights 4
 .Sh HISTORY
+The functions
+.Fn cap_rights_init ,
+.Fn cap_rights_set ,
+.Fn cap_rights_clear ,
+.Fn cap_rights_is_set ,
+.Fn cap_rights_is_valid ,
+.Fn cap_rights_merge ,
+.Fn cap_rights_remove 
+and
+.Fn cap_rights_contains
+first appeared in
+.Fx 8.3 .
 Support for capabilities and capabilities mode was developed as part of the
 .Tn TrustedBSD
 Project.

Modified: head/lib/libc/gen/cap_rights_get.3
==
--- head/lib/libc/gen/cap_rights_get.3  Tue Jun 16 15:54:59 2020
(r362229)
+++ head/lib/libc/gen/cap_rights_get.3  Tue Jun 16 16:48:52 2020
(r362230)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2014
+.Dd May 5, 2020
 .Dt CAP_RIGHTS_GET 3
 .Os
 .Sh NAME
@@ -110,6 +110,10 @@ argument points at an invalid address.
 .Xr capsicum 4 ,
 .Xr rights 4
 .Sh HISTORY
+The
+.Fn cap_rights_get
+function first appeared in
+.Fx 9.2 .
 Support for capabilities and capabilities mode was developed as part of the
 .Tn TrustedBSD
 Project.

Modified: head/lib/libc/gen/cap_sandboxed.3
==
--- head/lib/libc/gen/cap_sandboxed.3   Tue Jun 16 15:54:59 2020
(r362229)
+++ head/lib/libc/gen/cap_sandboxed.3   Tue Jun 16 16:48:52 2020
(r362230)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2014
+.Dd May 5, 2020
 .Dt CAP_SANDBOXED 3
 .Os
 .Sh NAME
@@ -65,6 +65,11 @@ or
 .Sh SEE ALSO
 .Xr cap_enter 2 ,
 .Xr capsicum 4
+.Sh HISTORY
+The
+.Fn cap_sandboxed
+function first appeared in
+.Fx 9.2 .
 .Sh AUTHORS
 This function was implemented and manual page was written by
 .An Pawel Jakub Dawidek Aq Mt pa...@dawidek.net

Modified: head/lib/libc/sys/cap_enter.2
==
--- head/lib/libc/sys/cap_enter.2   Tue Jun 16 15:54:59 2020
(r362229)
+++ head/lib/libc/sys/cap_enter.2   Tue Jun 16 16:48:52 2020
(r362230)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd May 23, 2017
+.Dd May 5, 2020
 .Dt CAP_ENTER 2
 .Os
 .Sh NAME
@@ -150,6 +150,10 @@ points outside the process's allocated address space.
 .Xr capsicum 4 ,
 .Xr sysctl 9
 .Sh HISTORY
+The
+.Fn cap_getmode
+system call first appeared in
+.Fx 8.3 .
 Support for capabilities and capabilities mode was developed as part of the
 .Tn TrustedBSD
 Project.

Modified: head/lib/libc/sys/cap_fcntls_limit.2
==
--- head/lib/libc/sys/cap_fcntls_limit.2Tue Jun 16 15:54:59 2020
(r362229)
+++ head/lib/libc/sys/cap_fcntls_limit.2Tue Jun 16 16:48:52 2020
(r362230)
@@ -28,7 +28,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 27, 2014
+.Dd May 5, 2020
 .Dt CAP_FCNTLS_LIMIT 2
 .Os
 .Sh NAME
@@ -117,6 +117,12 @@ argument points at an invalid address.
 .Xr cap_rights_limit 2 ,
 .Xr fcntl 2
 .Sh HISTORY
+The
+.Fn cap_fcntls_get
+and
+.Fn cap_fcntls_limit
+system calls first appeared in
+.Fx 8.3 .
 Support for capabilities and capabilities mode was developed as part of the
 .Tn TrustedBSD
 Project.

Modified: head/lib/libc/sys/cap_ioctls_limit.2
==
--- head/lib/libc/sys/cap_ioctls_limit.2Tue Jun 16 15:54:59 2020
(r362229)
+++ head/lib/libc/sys/cap_ioctls_limit.2Tue Jun 16 16:48:52 2020   

svn commit: r362229 - head/usr.bin/cmp

2020-06-16 Thread Fernando Apesteguía
Author: fernape (ports committer)
Date: Tue Jun 16 15:54:59 2020
New Revision: 362229
URL: https://svnweb.freebsd.org/changeset/base/362229

Log:
  cmp(1): Add EXAMPLES section
  
  Add simple examples showing the use of -l, -z, stdin and offsets
  
  Approved by:  bcr@
  Differential Revision: https://reviews.freebsd.org/D25280

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

Modified: head/usr.bin/cmp/cmp.1
==
--- head/usr.bin/cmp/cmp.1  Tue Jun 16 14:02:51 2020(r362228)
+++ head/usr.bin/cmp/cmp.1  Tue Jun 16 15:54:59 2020(r362229)
@@ -31,7 +31,7 @@
 .\" @(#)cmp.1  8.1 (Berkeley) 6/6/93
 .\" $FreeBSD$
 .\"
-.Dd May 1, 2018
+.Dd June 16, 2020
 .Dt CMP 1
 .Os
 .Sh NAME
@@ -106,6 +106,40 @@ file (before any differences were found).
 .It >1
 An error occurred.
 .El
+.Sh EXAMPLES
+Assuming a file named example.txt with the following contents:
+.Bd -literal -offset indent
+a
+b
+c
+.Ed
+.Pp
+Compare stdin with example.txt:
+.Bd -literal -offset indent
+$ echo -e "a\\nb\\nc" | cmp - example.txt
+.Ed
+.Pp
+Same as above but introducing a change in byte three in stdin.
+Show the byte number (decimal) and differing byte (octal):
+.Bd -literal -offset indent
+$ echo -e "a\\nR\\nc" | cmp -l - example.txt
+ 3 122 142
+.Ed
+.Pp
+Compare example.txt and /boot/loader.conf exiting if size differs.
+Note that
+.Fl z
+can only be used with regular files:
+.Bd -literal -offset indent
+$ cmp -z example.txt /boot/loader.conf
+example.txt /boot/loader.conf differ: size
+.Ed
+.Pp
+Compare stdin with file example.txt omitting the 4 first bytes from stdin and
+the 2 first bytes from example.txt:
+.Bd -literal -offset indent
+$ echo -e "a\\nR\\nb\\nc" | cmp - example.txt 4 2
+.Ed
 .Sh SEE ALSO
 .Xr diff 1 ,
 .Xr diff3 1
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362226 - head/share/man/man5

2020-06-16 Thread Baptiste Daroussin
Author: bapt
Date: Tue Jun 16 12:40:19 2020
New Revision: 362226
URL: https://svnweb.freebsd.org/changeset/base/362226

Log:
  Fix typo in the documentation about the daily ntpd status
  
  PR:   245679
  Submitted by: Taylor Stearns 
  MFC after:3 days

Modified:
  head/share/man/man5/periodic.conf.5

Modified: head/share/man/man5/periodic.conf.5
==
--- head/share/man/man5/periodic.conf.5 Tue Jun 16 12:26:23 2020
(r362225)
+++ head/share/man/man5/periodic.conf.5 Tue Jun 16 12:40:19 2020
(r362226)
@@ -25,7 +25,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd March 7, 2018
+.Dd June 16, 2020
 .Dt PERIODIC.CONF 5
 .Os
 .Sh NAME
@@ -518,7 +518,7 @@ for the previous day.
 .Pq Vt num
 Set to the number of maillog files that should be checked
 for yesterday's mail rejects.
-.It Va daily_status_ntpd
+.It Va daily_status_ntpd_enable
 .Pq Vt bool
 Set to
 .Dq Li YES
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362225 - head/sys/netinet/tcp_stacks

2020-06-16 Thread Randall Stewart
Author: rrs
Date: Tue Jun 16 12:26:23 2020
New Revision: 362225
URL: https://svnweb.freebsd.org/changeset/base/362225

Log:
  So it turns out rack has a shortcoming in dup-ack counting. It counts the 
dupacks but
  then does not properly respond to them. This is because a few missing bits 
are not present.
  BBR actually does properly respond (though it also sends a TLP which is 
interesting and
  maybe something to fix)..
  
  Sponsored by: Netflix Inc.
  Differential Revision:https://reviews.freebsd.org/D25294

Modified:
  head/sys/netinet/tcp_stacks/rack.c

Modified: head/sys/netinet/tcp_stacks/rack.c
==
--- head/sys/netinet/tcp_stacks/rack.c  Tue Jun 16 12:21:55 2020
(r362224)
+++ head/sys/netinet/tcp_stacks/rack.c  Tue Jun 16 12:26:23 2020
(r362225)
@@ -4588,7 +4588,7 @@ activate_rxt:
goto activate_rxt;
}
/* Convert from ms to usecs */
-   if (rsm->r_flags & RACK_SACK_PASSED) {
+   if ((rsm->r_flags & RACK_SACK_PASSED) || (rsm->r_dupack >= 
DUP_ACK_THRESHOLD)) {
if ((tp->t_flags & TF_SENTFIN) &&
((tp->snd_max - tp->snd_una) == 1) &&
(rsm->r_flags & RACK_HAS_FIN)) {
@@ -6237,7 +6237,7 @@ rack_log_output(struct tcpcb *tp, struct tcpopt *to, i
 * or FIN if seq_out is adding more on and a FIN is present
 * (and we are not resending).
 */
-   if ((th_flags & TH_SYN) && (seq_out == tp->iss)) 
+   if ((th_flags & TH_SYN) && (seq_out == tp->iss))
len++;
if (th_flags & TH_FIN)
len++;
@@ -8190,6 +8190,7 @@ rack_strike_dupack(struct tcp_rack *rack)
rsm->r_dupack++;
if (rsm->r_dupack >= DUP_ACK_THRESHOLD) {
rack->r_wanted_output = 1;
+   rack->r_timer_override = 1;
rack_log_retran_reason(rack, rsm, __LINE__, 1, 3);
} else {
rack_log_retran_reason(rack, rsm, __LINE__, 0, 3);
@@ -11359,7 +11360,8 @@ check_it:
if (rsm->r_flags & RACK_ACKED) {
return (NULL);
}
-   if ((rsm->r_flags & RACK_SACK_PASSED) == 0) {
+   if (((rsm->r_flags & RACK_SACK_PASSED) == 0) &&
+   (rsm->r_dupack < DUP_ACK_THRESHOLD)) {
/* Its not yet ready */
return (NULL);
}
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362220 - in head/contrib/opencsd: . decoder/build decoder/docs decoder/tests

2020-06-16 Thread Andrew Turner
Author: andrew
Date: Tue Jun 16 08:59:44 2020
New Revision: 362220
URL: https://svnweb.freebsd.org/changeset/base/362220

Log:
  Re-add opencsd as a vendor import from the dist directory
  
  Sponsored by: Innovate UK

Added:
  head/contrib/opencsd/
 - copied from r353392, vendor/opencsd/dist/
Deleted:
  head/contrib/opencsd/.gitignore
  head/contrib/opencsd/HOWTO.md
  head/contrib/opencsd/LICENSE
  head/contrib/opencsd/README.md
  head/contrib/opencsd/TODO
  head/contrib/opencsd/decoder/build/
  head/contrib/opencsd/decoder/docs/
  head/contrib/opencsd/decoder/tests/
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362219 - head/contrib/opencsd

2020-06-16 Thread Andrew Turner
Author: andrew
Date: Tue Jun 16 08:57:13 2020
New Revision: 362219
URL: https://svnweb.freebsd.org/changeset/base/362219

Log:
  Remove opencsd so I can re-import it with the correct ancestry
  
  Sponsored by: Innovate UK

Deleted:
  head/contrib/opencsd/
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362218 - head/stand/common

2020-06-16 Thread Toomas Soome
Author: tsoome
Date: Tue Jun 16 07:30:34 2020
New Revision: 362218
URL: https://svnweb.freebsd.org/changeset/base/362218

Log:
  loader: zfs_cmd.c does not really compile without libzfs.h
  
  Having libzfs.h wrapped in LOADER_ZFS_SUPPORT check does not really make 
sense,
  because we do need function declarations with C99.
  
  Sponsored by: Netflix, Klara Inc.

Modified:
  head/stand/common/zfs_cmd.c

Modified: head/stand/common/zfs_cmd.c
==
--- head/stand/common/zfs_cmd.c Tue Jun 16 07:05:03 2020(r362217)
+++ head/stand/common/zfs_cmd.c Tue Jun 16 07:30:34 2020(r362218)
@@ -37,10 +37,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include "bootstrap.h"
-
-#ifdef LOADER_ZFS_SUPPORT
 #include "libzfs.h"
-#endif
 
 COMMAND_SET(lszfs, "lszfs", "list child datasets of a zfs dataset",
command_lszfs);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r362217 - head/stand/common

2020-06-16 Thread Toomas Soome
Author: tsoome
Date: Tue Jun 16 07:05:03 2020
New Revision: 362217
URL: https://svnweb.freebsd.org/changeset/base/362217

Log:
  loader: variable i is unused without MBR/GPT support built in
  
  Because i is only used as index in for loop, declare it in for statement.
  
  Sponsored by: Netflix, Klara Inc.

Modified:
  head/stand/common/part.c

Modified: head/stand/common/part.c
==
--- head/stand/common/part.cTue Jun 16 04:17:08 2020(r362216)
+++ head/stand/common/part.cTue Jun 16 07:05:03 2020(r362217)
@@ -647,7 +647,6 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect
struct dos_partition *dp;
struct ptable *table;
uint8_t *buf;
-   int i;
 #ifdef LOADER_MBR_SUPPORT
struct pentry *entry;
uint32_t start, end;
@@ -720,7 +719,7 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect
 * start sector 1. After DOSPTYP_PMBR, there may be other partitions.
 * UEFI compliant PMBR has no other partitions.
 */
-   for (i = 0; i < NDOSPART; i++) {
+   for (int i = 0; i < NDOSPART; i++) {
if (dp[i].dp_flag != 0 && dp[i].dp_flag != 0x80) {
DPRINTF("invalid partition flag %x", dp[i].dp_flag);
goto out;
@@ -742,7 +741,7 @@ ptable_open(void *dev, uint64_t sectors, uint16_t sect
/* Read MBR. */
DPRINTF("MBR detected");
table->type = PTABLE_MBR;
-   for (i = has_ext = 0; i < NDOSPART; i++) {
+   for (int i = has_ext = 0; i < NDOSPART; i++) {
if (dp[i].dp_typ == 0)
continue;
start = le32dec(&(dp[i].dp_start));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r362211 - head/sbin/ifconfig

2020-06-16 Thread Mateusz Piotrowski
On 6/16/20 2:28 AM, Adrian Chadd wrote:
> Author: adrian
> Date: Tue Jun 16 00:28:08 2020
> New Revision: 362211
> URL: https://svnweb.freebsd.org/changeset/base/362211
> 
> Log:
>   [net80211] Add uapsd option to ifconfig
>   
>   Add an enable/disable option for controlling uapsd.  I'm not yet controlling
>   the individual AC configs or the service period.
> 
> Modified:
>   head/sbin/ifconfig/ifieee80211.c
> 
> Modified: head/sbin/ifconfig/ifieee80211.c
> ==

Should we document it now, or wait a while to see it is here to stay?

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