Re: Interrupt handler synchronization

2015-09-12 Thread Mark Kettenis
> Date: Sat, 12 Sep 2015 14:38:05 +0200 (CEST) > From: Mark Kettenis > > Since interrupt handlers are running asynchronously it is difficult to > make sure that one isn't running on another cpu while you're frobbing > data structures that you share with it. This is an

bsd.port.mk.5: Misc. tweaks

2015-09-12 Thread Michael Reed
Hi all, This patch consists of three small changes and one large one. The small changes are as follows: - In two places, replaced `...' style quoting with Sq, which is used throughout the manual. - added missing comma after `e.g.' - fixed spelling of `licencing' -> `licensing' The large

Re: More minor ksh stuff

2015-09-12 Thread Nicholas Marriott
Hi Why do you need to move tty_close? It is prototyped in tty.h which is included at the start of your diff. The other changes look good. On Sat, Sep 12, 2015 at 03:17:53PM -0400, Michael McConville wrote: > * move tty_close() up so that we can call it in tty_init() > * bump tfd's assignment

Re: PF SMP: making anchor stack multithreaded

2015-09-12 Thread Alexandr Nedvedicky
Hello, re-sending with updated patch version. I'd like to get it in, so I can start moving forward with other things. any O.Ks? thanks and regards sasha On Sat, Aug 08, 2015 at 12:16:26PM +0200, Alexandr Nedvedicky wrote: > Hello, > > I've reworked the anchor handling so the traversal uses

PF SMP: mutex for fragcache

2015-09-12 Thread Alexandr Nedvedicky
Hello, very small first step towards MP(i) friendly PF. Patch adds mutex around fragment cache. Patch adds a lock around fragment cache. Unlike other parts of PF the fragment cache is self-contained subsystem. In that sense we can easily guard its entry points (pf_reassemble(), pf_reassemble6())

Re: Floating point #define in ksh

2015-09-12 Thread Michael McConville
Todd C. Miller wrote: > On Michael McConville wrote: > > To be (far) more specific, it's used to enable the 'e', 'g', and 'f' > > fields of ksh's vfprintf() clone. On one hand, this can't be too > > important if it was disabled for >10 years. On the other, the code > > at least compiles... > >

More minor ksh stuff

2015-09-12 Thread Michael McConville
* move tty_close() up so that we can call it in tty_init() * bump tfd's assignment into its own line * realize that those if conditions are identical Index: tty.c === RCS file: /cvs/src/bin/ksh/tty.c,v retrieving revision 1.10

Re: UTF-8 string filtering

2015-09-12 Thread Stefan Sperling
On Fri, Sep 04, 2015 at 03:17:31PM +1000, Damien Miller wrote: > Hi, > > For a long time OpenBSD has been careful about filtering potentially- > hostile strings that were destined for logs or TTYs using strvis(3) and > friends. Unfortunately, these don't do a great job for UTF-8 strings > since

Re: nd6_lookup() and rt refcount

2015-09-12 Thread Martin Pieuchot
Thanks for your review. On 12/09/15(Sat) 15:30, Alexander Bluhm wrote: > [...] > Do you think it is a good idea to reuse the rt parameter in this > goto spaghetti mess? I looks correct, but I would keep a local > variable for this local route usage. Fine, I kept a local variable. > The

Re: Fewer RTF_UP

2015-09-12 Thread Claudio Jeker
On Sat, Sep 12, 2015 at 10:06:12AM +0200, Martin Pieuchot wrote: > Now that rtrequest1(9) properly set RTF_UP when a route is added, > there's no need to pass it to rt_ifa_add(9). > > rt_ifa_del(9) never needed it, but it has been set for documentation. > > ok? Yes, go for it. OK claudio@ >

Re: Floating point #define in ksh

2015-09-12 Thread Todd C. Miller
On Fri, 11 Sep 2015 23:41:40 -0400, Michael McConville wrote: > To be (far) more specific, it's used to enable the 'e', 'g', and 'f' > fields of ksh's vfprintf() clone. On one hand, this can't be too > important if it was disabled for >10 years. On the other, the code at > least compiles... When

ifconfig scan and UTF-8 wireless network IDs

2015-09-12 Thread Stefan Sperling
This shows how ifconfig could handle UTF-8 in wireless network IDs. I don't think this is a very important use case. But it's a nice case study for UTF-8 APIs nonetheless. I'm using parts of djm's stringprep work to match code points. Except in ifconfig we don't want to sanitize (i.e. change)

Re: Floating point #define in ksh

2015-09-12 Thread Nicholas Marriott
Works for me. ok anyone? I think ksh_limval.h can go entirely after this, per the note in PROJECTS. On Sat, Sep 12, 2015 at 03:00:02PM -0400, Michael McConville wrote: > Nicholas Marriott wrote: > > I would kill it. FPBUF_SIZE and DMAXEXP can go too. > > Here's the diff: > > > Index:

[PATCH] Initial implementation of posix_fallocate(2)

2015-09-12 Thread Dimitris Papastamos
Hi everyone, I've done a basic implementation of posix_fallocate(2). I've looked at both the FreeBSD and NetBSD code when doing this. My knowledge of the VFS layer is very limited, so please let me know if anything looks wrong. I added a generic function in vfs_vnops.c called vn_fallocate()

Re: [PATCH] Initial implementation of posix_fallocate(2)

2015-09-12 Thread Dimitris Papastamos
On Sat, Sep 12, 2015 at 06:57:48PM +0100, Dimitris Papastamos wrote: > + switch (fp->f_type) { > + case DTYPE_VNODE: > + break; > + case DTYPE_PIPE: > + case VFIFO: VFIFO shouldn't be here, I have moved it further down after vn_lock to check it against v_type.

Re: Floating point #define in ksh

2015-09-12 Thread Michael McConville
Nicholas Marriott wrote: > I would kill it. FPBUF_SIZE and DMAXEXP can go too. Here's the diff: Index: ksh_limval.h === RCS file: /cvs/src/bin/ksh/ksh_limval.h,v retrieving revision 1.2 diff -u -p -r1.2 ksh_limval.h ---

Re: kill struct inpcbtable's inpt_lastport

2015-09-12 Thread Claudio Jeker
On Sat, Sep 12, 2015 at 02:40:59PM +0200, Vincent Gross wrote: > inpt_lastport is never read without being written before, and only > in_pcbbind() > and in6_pcbsetport() are using it. This diff removes inpt_lastport from > struct inpcbtable and turns it into a local variable where it is used. > >

Re: pflow(4): reshuffle socreate(9)

2015-09-12 Thread Alexander Bluhm
On Sat, Sep 12, 2015 at 02:45:24PM +, Florian Obser wrote: > @@ -117,44 +117,12 @@ pflow_clone_create(struct if_clone *ifc, int unit) ... > MGET(pflowif->send_nam, M_WAIT, MT_SONAME); > - sin = mtod(pflowif->send_nam, struct sockaddr_in *); > - memset(sin, 0 , sizeof(*sin)); > -

Re: nd6_lookup() and rt refcount

2015-09-12 Thread Alexander Bluhm
On Sat, Sep 12, 2015 at 09:57:23PM +0200, Martin Pieuchot wrote: > Did I miss something else? I did not find anything. OK bluhm@ > @@ -1536,15 +1541,18 @@ struct nd_pfxrouter * > find_pfxlist_reachable_router(struct nd_prefix *pr) > { > struct nd_pfxrouter *pfxrtr; > - struct

Re: kill struct inpcbtable's inpt_lastport

2015-09-12 Thread Vincent Gross
On 09/12/15 22:10, Claudio Jeker wrote: > On Sat, Sep 12, 2015 at 02:40:59PM +0200, Vincent Gross wrote: >> inpt_lastport is never read without being written before, and only >> in_pcbbind() >> and in6_pcbsetport() are using it. This diff removes inpt_lastport from >> struct inpcbtable and turns

Re: Floating point #define in ksh

2015-09-12 Thread Michael McConville
Nicholas Marriott wrote: > Works for me. ok anyone? > > I think ksh_limval.h can go entirely after this, per the note in > PROJECTS. If we're in the business of deleting files, bin/ksh/INSTALL describes itself with the following: > [This file is the generic GNU autoconf/configure installation >

Re: Floating point #define in ksh

2015-09-12 Thread Michael McConville
Nicholas Marriott wrote: > Works for me. ok anyone? > > I think ksh_limval.h can go entirely after this, per the note in > PROJECTS. I also just found this gem. It only has one use, so it can probably be replaced. Am I interpreting it correctly? Index: shf.c

Re: Call for testers of restricted rmt(8)

2015-09-12 Thread Alexander Hall
On 09/11/15 19:33, Sebastien Marie wrote: On Fri, Sep 11, 2015 at 05:03:54PM +0200, Alexander Hall wrote: Is *anyone* but me using rdump(8) + rmt(8)? I use dump(8) for doing remote backup, but I don't use rmt(8), due to plaintext storage on remote side. I don't understand. What's

Re: More minor ksh stuff

2015-09-12 Thread Michael McConville
Nicholas Marriott wrote: > Why do you need to move tty_close? It is prototyped in tty.h which is > included at the start of your diff. > > The other changes look good. You're right. Here's a new diff: Index: tty.c === RCS file:

Re: Call for testers of restricted rmt(8)

2015-09-12 Thread Sebastien Marie
First, some generals remarks: - The debug feature (not documented) defeat the `-r' flag purpose. I think the code should be either: - enclosed in #ifdef DEBUG (prefered way) - not permitted if `rflag' or `wflag' are setted - Adding tame(2) may be a good way to enforce the policyi, but

Fewer RTF_UP

2015-09-12 Thread Martin Pieuchot
Now that rtrequest1(9) properly set RTF_UP when a route is added, there's no need to pass it to rt_ifa_add(9). rt_ifa_del(9) never needed it, but it has been set for documentation. ok? Index: net/route.c === RCS file:

Re: Floating point #define in ksh

2015-09-12 Thread Nicholas Marriott
I would kill it. FPBUF_SIZE and DMAXEXP can go too. On Fri, Sep 11, 2015 at 11:41:40PM -0400, Michael McConville wrote: > Michael McConville wrote: > > FP has been undefined for at least ten years, and probably forever. > > It's used to conditionally add two small sections and one large > >

nd6_lookup() and rt refcount

2015-09-12 Thread Martin Pieuchot
This diff removes a tricky "rt->rt_refcnt--". It changes the behavior of nd6_lookup() to always return a route entry with a valid reference count. That means that rtfree(9) should be called after nd6_lookup(). There's on hairy case in nd6_output(). This is because of the dance done in

Redundant logic in /etc/rc.d/spamlogd

2015-09-12 Thread Nathanael Rensen
The logic to disable spamlogd when spamd is not enabled was added to _rc_quirks() in /etc/rc.d/rc.subr. The corresponding logic that remains in /etc/rc.d/spamlogd became ineffective when additional code was added below it anyway. Index: spamlogd

pflow(4): reshuffle socreate(9)

2015-09-12 Thread Florian Obser
Call socreate(9) only when we have a destination ip and port. Call sobind(9) only when we have a source ip. With this we can treat sc->so != NULL as a flag if the interface is in state IFF_RUNNING. OK? diff --git if_pflow.c if_pflow.c index c70ad81..829ec72 100644 --- if_pflow.c +++ if_pflow.c

Re: nat-to/af-to samples for examples/pf.conf

2015-09-12 Thread Mike Belopuhov
On 12 September 2015 at 14:12, Stuart Henderson wrote: > What does anyone think about adding commented-out sections > dealing with nat and nat64/dns64 to examples/pf.conf and > unbound.conf? > > Index: etc/examples/pf.conf I think it's a good idea.

Re: rc script for ftp-proxy with v6

2015-09-12 Thread Stefan Sperling
On Sat, Sep 12, 2015 at 02:29:32PM +0200, Mike Belopuhov wrote: > On 12 September 2015 at 14:20, Stuart Henderson wrote: > > ftp-proxy can only open one listening socket, so to use it with > > both IPv4 and IPv6, two instances are required. Now that rc.subr > > does exact

Re: fix openssl(1) prime output

2015-09-12 Thread Bob Beck
ok On Sat, Sep 12, 2015 at 7:26 AM, Lawrence Teo wrote: > When the openssl(1) prime command is asked to check the primality of a > decimal number, it changes it to hex in the output which is a little > confusing: > > $ openssl prime 976110468996539 > 377C46DC41DBB is prime >

Re: nd6_lookup() and rt refcount

2015-09-12 Thread Alexander Bluhm
On Sat, Sep 12, 2015 at 11:17:54AM +0200, Martin Pieuchot wrote: > I'd like to have careful reviews. I'm running with this for a couple > of months but I doubt I'm exercising all the code paths. > @@ -1677,24 +1677,21 @@ icmp6_redirect_output(struct mbuf *m0, s > > { > /*

nat-to/af-to samples for examples/pf.conf

2015-09-12 Thread Stuart Henderson
What does anyone think about adding commented-out sections dealing with nat and nat64/dns64 to examples/pf.conf and unbound.conf? Index: etc/examples/pf.conf === RCS file: /cvs/src/etc/examples/pf.conf,v retrieving revision 1.2 diff

rc script for ftp-proxy with v6

2015-09-12 Thread Stuart Henderson
ftp-proxy can only open one listening socket, so to use it with both IPv4 and IPv6, two instances are required. Now that rc.subr does exact matches of the process name, we could add a separate rc script for this. Do we want to do this? (snmpd and ntpd have the same restriction, but don't have a

Re: rc script for ftp-proxy with v6

2015-09-12 Thread Mike Belopuhov
On 12 September 2015 at 14:20, Stuart Henderson wrote: > ftp-proxy can only open one listening socket, so to use it with > both IPv4 and IPv6, two instances are required. Now that rc.subr > does exact matches of the process name, we could add a separate > rc script for this.

Interrupt handler synchronization

2015-09-12 Thread Mark Kettenis
Since interrupt handlers are running asynchronously it is difficult to make sure that one isn't running on another cpu while you're frobbing data structures that you share with it. This is an issue for example in our network drivers, where we want to clean up the rings when we bring the interface

kill struct inpcbtable's inpt_lastport

2015-09-12 Thread Vincent Gross
inpt_lastport is never read without being written before, and only in_pcbbind() and in6_pcbsetport() are using it. This diff removes inpt_lastport from struct inpcbtable and turns it into a local variable where it is used. Ok ? -- Vincent Index: sys/netinet/in_pcb.c

fix openssl(1) prime output

2015-09-12 Thread Lawrence Teo
When the openssl(1) prime command is asked to check the primality of a decimal number, it changes it to hex in the output which is a little confusing: $ openssl prime 976110468996539 377C46DC41DBB is prime The following diff fixes this so that it will always show the original number in the

Re: fix openssl(1) prime output

2015-09-12 Thread Miod Vallat
> When the openssl(1) prime command is asked to check the primality of a > decimal number, it changes it to hex in the output which is a little > confusing: > > $ openssl prime 976110468996539 > 377C46DC41DBB is prime > > The following diff fixes this so that it will always show the original >

Re: rc script for ftp-proxy with v6

2015-09-12 Thread Antoine Jacoutot
On Sat, Sep 12, 2015 at 01:20:39PM +0100, Stuart Henderson wrote: > ftp-proxy can only open one listening socket, so to use it with > both IPv4 and IPv6, two instances are required. Now that rc.subr > does exact matches of the process name, we could add a separate > rc script for this. Do we want