Fix for "Implement VFS read clustering for MSDOSFS"

2017-05-29 Thread Stefan Fritsch
Last year, mpi@ implemented VFS read clustering for MSDOSFS in sys/msdosfs/denode.h 1.28 sys/msdosfs/msdosfs_vnops.c 1.105 This caused regressions when doing seeks past the end of the file and had to be reverted. I have now written a test that catches the bug (committed in

Re: Fix for "Implement VFS read clustering for MSDOSFS"

2017-05-29 Thread Stefan Fritsch
On Mon, 29 May 2017, Martin Pieuchot wrote: > A complete diff would be easier to review. ok, here it comes. The original commit message was this: Implement VFS read clustering for MSDOSFS. The logic used in msdosfs_bmap() to loop calling pcbmap() comes from FreeBSD and

Re: Fix for "Implement VFS read clustering for MSDOSFS"

2017-05-29 Thread Martin Pieuchot
On 29/05/17(Mon) 14:15, Stefan Fritsch wrote: > Last year, mpi@ implemented VFS read clustering for MSDOSFS in > > sys/msdosfs/denode.h 1.28 > sys/msdosfs/msdosfs_vnops.c 1.105 > > This caused regressions when doing seeks past the end of the file and had > to be reverted. > > I have now

PF + pflow and NET_LOCK() recursion

2017-05-29 Thread Martin Pieuchot
Now that packets are queued the recursion is gone and we can keep the lock. ok? Index: net/pf.c === RCS file: /cvs/src/sys/net/pf.c,v retrieving revision 1.1030 diff -u -p -r1.1030 pf.c --- net/pf.c28 May 2017 16:55:54 -

Re: [PATCH] ntpd: allow to specify a source IP address for outgoing queries

2017-05-29 Thread Stuart Henderson
On 2017/05/29 10:04, Henning Brauer wrote: > * Sebastian Benoit [2017-05-28 22:52]: > > which makes me think: > > would a global local-address be good enough? > > I think so. This is a kinda weird/rare case. I agree. There's always NAT for special cases.

Re: CVS: cvs.openbsd.org: src - removal of sys/scanio.h

2017-05-29 Thread Ted Unangst
Sebastien Marie wrote: > On Mon, May 29, 2017 at 06:10:51AM -0600, Ted Unangst wrote: > > CVSROOT:/cvs > > Module name:src > > Changes by: t...@cvs.openbsd.org2017/05/29 06:10:51 > > > > Removed files: > > sys/sys: scanio.h > > > > Log message: > > scanner support

Re: CVS: cvs.openbsd.org: src - removal of sys/scanio.h

2017-05-29 Thread Sebastien Marie
On Mon, May 29, 2017 at 06:10:51AM -0600, Ted Unangst wrote: > CVSROOT: /cvs > Module name: src > Changes by: t...@cvs.openbsd.org2017/05/29 06:10:51 > > Removed files: > sys/sys: scanio.h > > Log message: > scanner support died some time ago, the header can be removed

Re: Fewer KERNEL_LOCK() for IPsec

2017-05-29 Thread Alexander Bluhm
On Sun, May 28, 2017 at 04:06:22PM +0200, Martin Pieuchot wrote: > Our original plan was to unlock the forwarding path without taking any > lock. That's why I added some KERNEL_LOCK()/KERNEL_UNLOCK() around non > MP-safe data structures. > > Now we're going to rely on the NET_LOCK() for the

Re: Fix for "Implement VFS read clustering for MSDOSFS"

2017-05-29 Thread Martin Pieuchot
On 29/05/17(Mon) 14:30, Stefan Fritsch wrote: > On Mon, 29 May 2017, Martin Pieuchot wrote: > > > A complete diff would be easier to review. > > ok, here it comes. > > The original commit message was this: > > Implement VFS read clustering for MSDOSFS. > > The logic used in

Re: CVS: cvs.openbsd.org: src - removal of sys/scanio.h

2017-05-29 Thread Sebastien Marie
On Mon, May 29, 2017 at 03:40:59PM +0200, Sebastien Marie wrote: > On Mon, May 29, 2017 at 06:10:51AM -0600, Ted Unangst wrote: > > CVSROOT:/cvs > > Module name:src > > Changes by: t...@cvs.openbsd.org2017/05/29 06:10:51 > > > > Removed files: > > sys/sys: scanio.h >

Re: ksh(1): vi mode UTF-8 bug

2017-05-29 Thread Ingo Schwarze
Hi, ooops, correcting myself... Ingo Schwarze wrote on Mon, May 29, 2017 at 04:16:06PM +0200: > It seems that here, you may need to measure the length of the character > to insert in bytes and then call something like > > putbuf(cmd + 1, #bytes, 0); It isn't that simple. At this point,

Re: ksh(1): vi mode UTF-8 bug

2017-05-29 Thread Walter Alejandro Iglesias
On Mon, May 29, 2017 at 05:59:34PM +0200, Ingo Schwarze wrote: > So handling multi-byte "r" should probably be treated as a separate > issue. > I'm just a beginner with C, what I'm about to say is purely intuitive. As far as I can understand you're trying to adapt the code that works with ascii

Make clang accept and use relative filenames for tools

2017-05-29 Thread Vadim Zhukov
The clang and gcc behave differently regarding executing tools. While gcc simply runs what he said to, clang tries to be clever and always find absolute path for a tool, refusing start otherwise. The actual problem is starting a linker: ports infrastructure expects tools are called by name, not

Re: ksh(1): vi mode UTF-8 bug

2017-05-29 Thread Ingo Schwarze
Hi, Anton Lindqvist wrote on Sun, May 28, 2017 at 06:07:00PM +0200: > On Sun, May 28, 2017 at 10:56:19AM +0200, Walter Alejandro Iglesias wrote: >> There is still a similar issue when you try to "replace" a utf-8 >> character (in command mode press 'r' to replace a single character or >> 'R' to

Properly serialize pflow's sc_outputqueue

2017-05-29 Thread Visa Hankala
Currently, access to pflow's sc_outputqueue is not serialized properly. The producer has the NET_LOCK(), while the consumer does not. mpi@ suggested using mbuf_queue to solve the issue. OK? Index: net/if_pflow.c === RCS file:

Re: ksh(1): vi mode UTF-8 bug

2017-05-29 Thread Ingo Schwarze
Hi Walter, Walter Alejandro Iglesias wrote on Mon, May 29, 2017 at 06:44:40PM +0200: > Are those wide char versions of C functions consistent enough to write > a separate implementation to be loaded when LC_TYPE is set to utf-8? Sure, you can rewrite the complete shell to use wchar_t * rather

wsfont: remove lucida16x29.h and omron12x20?

2017-05-29 Thread Frederic Cambus
Hi, Those fonts are not compiled in by default, and I see no reason to keep them: lucida16x29 is a bad conversion from a truetype font, it is too bold which makes it unreadable and unusable. omron12x20 is a serif font, and is very difficult to read due to inconsistencies in character spacing,

Re: wsfont: remove lucida16x29.h and omron12x20?

2017-05-29 Thread Mike Larkin
On Mon, May 29, 2017 at 04:30:26PM +0200, Frederic Cambus wrote: > Hi, > > Those fonts are not compiled in by default, and I see no reason > to keep them: > > lucida16x29 is a bad conversion from a truetype font, it is too bold > which makes it unreadable and unusable. > > omron12x20 is a serif

Re: Remove unused function from compress(1)

2017-05-29 Thread Frederic Cambus
On Tue, May 23, 2017 at 12:12:11PM -0400, Brian Callahan wrote: > clang says zclose is an unused function. Seems to check out. Commited, thanks!

Re: PF + pflow and NET_LOCK() recursion

2017-05-29 Thread Alexandr Nedvedicky
Hello, On Mon, May 29, 2017 at 02:32:06PM +0200, Martin Pieuchot wrote: > Now that packets are queued the recursion is gone and we can keep > the lock. makes sense. please commit this diff so I can pull back your change from tree to my patch. OK sashan@

Re: Make clang accept and use relative filenames for tools

2017-05-29 Thread Vadim Zhukov
2017-05-29 20:26 GMT+03:00 Vadim Zhukov : > The clang and gcc behave differently regarding executing tools. > While gcc simply runs what he said to, clang tries to be clever > and always find absolute path for a tool, refusing start otherwise. > > The actual problem is starting

Re: Make clang accept and use relative filenames for tools

2017-05-29 Thread Stuart Henderson
On 2017/05/29 20:26, Vadim Zhukov wrote: > The clang and gcc behave differently regarding executing tools. > While gcc simply runs what he said to, clang tries to be clever > and always find absolute path for a tool, refusing start otherwise. > > The actual problem is starting a linker: ports

Re: ksh(1): vi mode UTF-8 bug

2017-05-29 Thread Walter Alejandro Iglesias
On Mon, May 29, 2017 at 07:28:37PM +0200, Ingo Schwarze wrote: > Hi Walter, > > Walter Alejandro Iglesias wrote on Mon, May 29, 2017 at 06:44:40PM +0200: > > > Are those wide char versions of C functions consistent enough to write > > a separate implementation to be loaded when LC_TYPE is set to

Re: Make clang accept and use relative filenames for tools

2017-05-29 Thread Mark Kettenis
> From: Vadim Zhukov > Date: Mon, 29 May 2017 20:29:20 +0300 > > 2017-05-29 20:26 GMT+03:00 Vadim Zhukov : > > The clang and gcc behave differently regarding executing tools. > > While gcc simply runs what he said to, clang tries to be clever > > and

Re: Make clang accept and use relative filenames for tools

2017-05-29 Thread Vadim Zhukov
2017-05-29 21:14 GMT+03:00 Mark Kettenis : >> From: Vadim Zhukov >> Date: Mon, 29 May 2017 20:29:20 +0300 >> >> 2017-05-29 20:26 GMT+03:00 Vadim Zhukov : >> > The clang and gcc behave differently regarding executing tools. >> >

Re: Make clang accept and use relative filenames for tools

2017-05-29 Thread Vadim Zhukov
2017-05-29 20:54 GMT+03:00 Stuart Henderson : > On 2017/05/29 20:26, Vadim Zhukov wrote: >> The clang and gcc behave differently regarding executing tools. >> While gcc simply runs what he said to, clang tries to be clever >> and always find absolute path for a tool, refusing

Fix some mg(1) warnings

2017-05-29 Thread Brian Callahan
Hi tech -- This diff cleans up some warnings found with WARNINGS=yes and compiling with both cc and clang. I ignored the -Wsign-compare and -Wmissing-prototypes warnings. ~Brian Index: dir.c === RCS file:

Re: ksh(1): vi mode UTF-8 bug

2017-05-29 Thread Theo de Raadt
> Sure, you can rewrite the complete shell to use wchar_t * rather > than char *, and if you do that, you can use the new code to handle > ASCII as well, no need to have two copies. But that would be a > huge effort, even more error-prone than the small, careful adjustments > we are doing now,

Use LIST in PF_KEY

2017-05-29 Thread Claudio Jeker
Use LIST macros in PF_KEY code instead of the hand rolled one. Seems to work for me. -- :wq Claudio Index: net/pfkeyv2.c === RCS file: /cvs/src/sys/net/pfkeyv2.c,v retrieving revision 1.159 diff -u -p -r1.159 pfkeyv2.c ---

Makefile.cross tweaks

2017-05-29 Thread Miod Vallat
The following diff attempts to cross-build more things, in particular gnu/lib (except for libiberty). It also passes the proper optimization flags so that libstdc++-v3 gets built with optimization. Index: Makefile.cross === RCS file:

Fix some ps(1) warnings

2017-05-29 Thread Brian Callahan
Hi tech -- This diff fixes some warnings for ps(1) found with WARNINGS=yes. mbwsprint() was missing a prototype in utf8.c, so add it to extern.h with every other function. This lets us remove the prototype from print.c ~Brian Index: extern.h

Re: [PATCH] ntpd: allow to specify a source IP address for outgoing queries

2017-05-29 Thread Henning Brauer
* Sebastian Benoit [2017-05-28 22:52]: > which makes me think: > would a global local-address be good enough? I think so. This is a kinda weird/rare case. -- Henning Brauer, h...@bsws.de, henn...@openbsd.org BS Web Services GmbH, http://bsws.de, Full-Service ISP Secure

There is only one PFKEY version, kill pfkey.c

2017-05-29 Thread Claudio Jeker
Reduce the abstraction of pfkey a bit by admitting that we will only ever do v2 of the pfkey protocol. This will make it easier to make the pcb layer more like the one of the rtsock.c Would also be possible to keep pfkey.c with the pcb layer in it and have pfkeyv2 only do the protocol handling...

Re: nvme hibernate

2017-05-29 Thread Jonathan Matthew
On Sun, May 28, 2017 at 06:49:53PM +1000, Jonathan Matthew wrote: > This adds a side effect free io path to nvme(4) allowing it to be used for > hibernate. I've only tested this in a qemu vm, which successfully hibernates > but falls over weirdly trying to resume. This version has survived

Re: marco's plaintext history patch

2017-05-29 Thread Theo Buehler
On Fri, Apr 28, 2017 at 10:01:06AM +0200, Theo Buehler wrote: > This is an updated version of an old patch by marco [1], including some > improvements and fixes by natano and me. Here's marco's description: > > > I have had enough of corrupt ksh history so I had a look at the code to > > try to

tcpdump: enable some more bgp info

2017-05-29 Thread Michal Mazurek
The error information for bgp was commited in 2009 (bgpnotify_minor_cease, bgpnotify_minor_cap) but never enabled, so do that here. Also add FSM error codes. Index: print-bgp.c === RCS file: /cvs/src/usr.sbin/tcpdump/print-bgp.c,v

tcpdump: fix some clang warnings

2017-05-29 Thread Michal Mazurek
"plen" and "len" are of type "u_int" and never negative. Index: usr.sbin/tcpdump/print-bgp.c === RCS file: /cvs/src/usr.sbin/tcpdump/print-bgp.c,v retrieving revision 1.21 diff -u -p -r1.21 print-bgp.c ---

Re: tcpdump: enable some more bgp info

2017-05-29 Thread Job Snijders
On Mon, May 29, 2017 at 12:02:33PM +0200, Michal Mazurek wrote: > The error information for bgp was commited in 2009 > (bgpnotify_minor_cease, bgpnotify_minor_cap) but never enabled, so do > that here. Also add FSM error codes. perhaps add a comment like /* RFC 6608 */ above the below: > +static

Re: shorten ifconfig output for vnetids and parent interfaces

2017-05-29 Thread Sebastian Benoit
David Gwynne(da...@gwynne.id.au) on 2017.05.29 15:34:51 +1000: > this rolls vnetid and parent into a single encap line in ifconfig. > > eg: > > - vnetid: 7 > - parent: ix1 > + encap: vnetid: 7 parent: ix1 > > after this i would like to get rid of the vlan compat goo. > > ok?

remove router solicitation sending and router advertisement processing from kernel

2017-05-29 Thread Florian Obser
This is more for krautbackup purposes. Not going to ask for OKs any time soon. But if you are sufficiently bored you might want to run with this and slaacd. I would also be interested if this breaks anything on v6 routers or hosts that do not use autoconfiguration. net/if.c| 10

Re: shorten ifconfig output for vnetids and parent interfaces

2017-05-29 Thread Reyk Floeter
> Am 29.05.2017 um 07:34 schrieb David Gwynne : > > this rolls vnetid and parent into a single encap line in ifconfig. > > eg: > > - vnetid: 7 > - parent: ix1 > + encap: vnetid: 7 parent: ix1 > The repeated colons for keys after encap: are unusual for

Re: shorten ifconfig output for vnetids and parent interfaces

2017-05-29 Thread Theo de Raadt
> > - vnetid: 7 > > - parent: ix1 > > + encap: vnetid: 7 parent: ix1 > >=20 > > The repeated colons for keys after encap: are unusual for ifconfig output, c= > ould you just skip them like the following: > > encap: vnetid 7 parent ix1 true

Re: making rtsock more MP save using SRP list for pcbs

2017-05-29 Thread Claudio Jeker
On Sun, May 28, 2017 at 04:22:20PM +0200, Claudio Jeker wrote: > This is a start at pushing locking down into the socket layer. Use a > SRPL list to manage the route PCBs and start running stuff without the > kernel lock where save. Includes some cleanup since rawcb was removed in > along the

Re: [patch] ND_COMPUTER_RTIME is not uniformly distributed

2017-05-29 Thread Theo Buehler
On Fri, May 19, 2017 at 09:05:38AM +0200, Theo Buehler wrote: > On Mon, May 15, 2017 at 03:49:55PM +0200, Mike Belopuhov wrote: > > On Sun, May 07, 2017 at 18:59 -0500, Matthew Martin wrote: > > > RFC 4861 specifies ReachableTime "should be a uniformly distributed > > > random value between

Re: slaacd(8): early testing now possible

2017-05-29 Thread Florian Obser
as naddy found out the hard way we also need to stop the kernel from sending router solicitations or things get confused rather quickly, this is better: diff --git sys/netinet6/nd6_rtr.c sys/netinet6/nd6_rtr.c index 7fc1e36e0ec..89c6d1dd078 100644 --- sys/netinet6/nd6_rtr.c +++

Prevent NET_LOCK() vs if_get() deadlock

2017-05-29 Thread Martin Pieuchot
As explained recently, calling refcnt_finalize() for ifp references and sleeping while holding the NET_LOCK() creates a deadlock situation. However we can simply fix that by not calling if_idxmap_remove() under the NET_LOCK(). This is safe since the KERNEL_LOCK() is what is needed to serialize

ip_input() in pr_input style

2017-05-29 Thread Alexander Bluhm
Hi, Convert ip_input(), ip_our(), ip_deliver() functions to pr_input parameter passing and protocol return style. Reset mp to NULL in a few places to fail at mbuf use after free. Rename ipv4_input() to ip_input(). Goal is to prepare the code that both mpi@'s and bluhm@'s diff apply. ok?

Re: Fix some ps(1) warnings

2017-05-29 Thread Brian Callahan
Hi Ingo -- On 5/29/2017 5:30 PM, Ingo Schwarze wrote: > Hi Brian, > > Brian Callahan wrote on Mon, May 29, 2017 at 04:44:01PM -0400: > >> This diff fixes some warnings for ps(1) found with WARNINGS=yes. >> mbwsprint() was missing a prototype in utf8.c, so add it to >> extern.h with every other

Silence some warnings in top(1)

2017-05-29 Thread Brian Callahan
Hi tech -- Silence some warnings in top(1) found by WARNINGS=yes. ~Brian Index: machine.c === RCS file: /cvs/src/usr.bin/top/machine.c,v retrieving revision 1.88 diff -u -p -u -p -r1.88 machine.c --- machine.c 15 Mar 2017

Fix some w(1) warnings, remove bin/ps/fmt.c

2017-05-29 Thread Brian Callahan
Hi tech -- While building w(1) with WARNINGS=yes, clang complained that there were missing prototypes for the functions fmt_putc and fmt_puts. w(1) is doing a reacharound to ps(1) for these functions. And while putting the prototypes in bin/ps/extern.h silenced the warnings, that seemed strange.

Silence some warnings in calendar(1)

2017-05-29 Thread Brian Callahan
Hi tech -- Fix some warnings found with WARNINGS=yes. I believe setting ev1 = NULL in io.c is a false positive by cc but I fixed it anyway. ~Brian Index: day.c === RCS file: /cvs/src/usr.bin/calendar/day.c,v retrieving revision

Re: tcpdump: fix some clang warnings

2017-05-29 Thread Alexander Bluhm
On Mon, May 29, 2017 at 12:13:25PM +0200, Michal Mazurek wrote: > --- usr.sbin/tcpdump/print-bgp.c 24 Apr 2017 20:35:35 - 1.21 > +++ usr.sbin/tcpdump/print-bgp.c 29 May 2017 10:08:40 - > @@ -356,7 +356,7 @@ decode_prefix4(const u_char *pd, char *b > *

fortune(6): use proper bool types

2017-05-29 Thread Frederic Cambus
Hi tech@, Here is a diff to use proper bool types for fortune(6). Comments? OK? Index: games/fortune/fortune/fortune.c === RCS file: /cvs/src/games/fortune/fortune/fortune.c,v retrieving revision 1.55 diff -u -p -r1.55 fortune.c

Re: Make clang accept and use relative filenames for tools

2017-05-29 Thread Joerg Sonnenberger
On Mon, May 29, 2017 at 06:54:52PM +0100, Stuart Henderson wrote: > On 2017/05/29 20:26, Vadim Zhukov wrote: > > The clang and gcc behave differently regarding executing tools. > > While gcc simply runs what he said to, clang tries to be clever > > and always find absolute path for a tool,

Silence a hexdump(1) warning

2017-05-29 Thread Brian Callahan
Hi tech -- Silence a -Wshadow warning found with WARNINGS=yes. ~Brian Index: odsyntax.c === RCS file: /cvs/src/usr.bin/hexdump/odsyntax.c,v retrieving revision 1.27 diff -u -p -u -p -r1.27 odsyntax.c --- odsyntax.c 15 Mar 2016

Re: Fix some ps(1) warnings

2017-05-29 Thread Ingo Schwarze
Hi Brian, Brian Callahan wrote on Mon, May 29, 2017 at 04:44:01PM -0400: > This diff fixes some warnings for ps(1) found with WARNINGS=yes. > mbwsprint() was missing a prototype in utf8.c, so add it to > extern.h with every other function. This lets us remove the > prototype from print.c I

Re: Prevent NET_LOCK() vs if_get() deadlock

2017-05-29 Thread David Gwynne
i came up with what is effectively the same diff. ok by me. > On 29 May 2017, at 20:37, Martin Pieuchot wrote: > > As explained recently, calling refcnt_finalize() for ifp references and > sleeping while holding the NET_LOCK() creates a deadlock situation. > > However we can

pcdisplay(4): remove unused pcdisplay_mapchar_simple function

2017-05-29 Thread Frederic Cambus
Hi tech@, Here is a diff to remove the unused pcdisplay_mapchar_simple function in pcdisplay(4). It has been unused since this code was imported from NetBSD. Comments? OK? Index: sys/dev/ic/pcdisplay_subr.c === RCS file:

Silence some warnings in tftp(1)

2017-05-29 Thread Brian Callahan
Hi tech -- Silence some warnings in tftp(1) found by WARNINGS=yes. ~Brian Index: main.c === RCS file: /cvs/src/usr.bin/tftp/main.c,v retrieving revision 1.41 diff -u -p -u -p -r1.41 main.c --- main.c 21 Jan 2017 11:32:04 -

Fix vmstat(8) warnings

2017-05-29 Thread Brian Callahan
Hi tech -- Silence a pair of -Wshadow warnings caught by WARNINGS=yes. ~Brian Index: dkstats.c === RCS file: /cvs/src/usr.bin/vmstat/dkstats.c,v retrieving revision 1.39 diff -u -p -u -p -r1.39 dkstats.c --- dkstats.c 4 Sep 2016

Re: pcdisplay(4): remove unused pcdisplay_mapchar_simple function

2017-05-29 Thread Mike Larkin
On Mon, May 29, 2017 at 11:09:06PM +0200, Frederic Cambus wrote: > Hi tech@, > > Here is a diff to remove the unused pcdisplay_mapchar_simple function > in pcdisplay(4). > > It has been unused since this code was imported from NetBSD. > > Comments? OK? > ok mlarkin > Index: