Re: remove unused rtentry parameter from rtm_addr()

2018-04-18 Thread Florian Obser
On Wed, Apr 18, 2018 at 11:31:02PM +0200, Alexander Bluhm wrote: > On Wed, Apr 18, 2018 at 05:03:04PM +0200, Florian Obser wrote: > > @@ -1158,9 +1158,9 @@ rt_ifa_del(struct ifaddr *ifa, int flags, struct > > sockaddr *dst) > > error = rtrequest_delete(&info, prio, ifp, &rt, rtableid); > >

start splitting kern.9 up

2018-04-18 Thread David Gwynne
like a small handful of man pages, kern.9 puts prototypes in places other than the SYNOPSIS section. of these, it is probably the most straightforward to fix. kern.9 documents a bunch of different apis provided by "libkern", but they can be split out into manpages for each type of api. this diff ta

Re: remove unused rtentry parameter from rtm_addr()

2018-04-18 Thread Alexander Bluhm
On Wed, Apr 18, 2018 at 05:03:04PM +0200, Florian Obser wrote: > @@ -1158,9 +1158,9 @@ rt_ifa_del(struct ifaddr *ifa, int flags, struct > sockaddr *dst) > error = rtrequest_delete(&info, prio, ifp, &rt, rtableid); > if (error == 0) { > rtm_send(rt, RTM_DELETE, 0, rtableid

Re: ifconfig,route,netstat: s/tableid/rtable/ for consistency

2018-04-18 Thread Klemens Nanni
On Fri, Apr 13, 2018 at 02:38:07PM +0200, Klemens Nanni wrote: > On Thu, Apr 12, 2018 at 10:07:58AM +0200, Peter Hessler wrote: > > On 2018 Apr 11 (Wed) at 23:01:45 +0200 (+0200), Klemens Nanni wrote: > > :On Wed, Apr 11, 2018 at 09:28:03AM +0200, Peter Hessler wrote: > > :> No, all of these uses a

RTM_CHGADDRATTR: route(8)

2018-04-18 Thread Florian Obser
diff --git route.c route.c index 9c85f70de78..a9ee414c562 100644 --- route.c +++ route.c @@ -1257,7 +1257,8 @@ char *msgtypes[] = { "RTM_DESYNC: route socket overflow", "RTM_INVALIDATE: invalidate cache of L2 route", "RTM_BFD: bidirectional forwarding detection", - "RT

RTM_CHGADDRATTR

2018-04-18 Thread Florian Obser
On Wed, Apr 18, 2018 at 05:05:59PM +0200, Florian Obser wrote: > This is to inform userland (i.e. slaacd(8)) when duplicate address > detection finishes. > > Not a big fan of the lock/unlock dance but I guess it can't be helped > for now. > > Comments, OKs? Theo points out that I suck at naming

Re: whitelist /etc/networks with pledge("dns")

2018-04-18 Thread Florian Obser
On Wed, Apr 18, 2018 at 07:13:49PM +0200, Florian Obser wrote: > So I was puzzled why route(8) pledges rpath. As far as I can work out > it's because asr tries to open /etc/networks in getnetnamadr_async.c > (line 183). > > If we whitelist that file like all the other things asr needs we can > dro

Re: whitelist /etc/networks with pledge("dns")

2018-04-18 Thread Theo de Raadt
Well the other approach would be to finally delete support for /etc/networks Florian Obser wrote: > So I was puzzled why route(8) pledges rpath. As far as I can work out > it's because asr tries to open /etc/networks in getnetnamadr_async.c > (line 183). > > If we whitelist that file li

whitelist /etc/networks with pledge("dns")

2018-04-18 Thread Florian Obser
So I was puzzled why route(8) pledges rpath. As far as I can work out it's because asr tries to open /etc/networks in getnetnamadr_async.c (line 183). If we whitelist that file like all the other things asr needs we can drop the rpath pledge in route(8). Thoughts? diff --git sbin/route/route.c s

Re: remove unused rtentry parameter from rtm_addr()

2018-04-18 Thread Klemens Nanni
On Wed, Apr 18, 2018 at 05:03:04PM +0200, Florian Obser wrote: > some dude commited it like this in '95. It used to be used until mpi@ started passing ifa: "Pass the configured ``ifa'' to rt_sendaddrmsg() instead of getting it via ``rt->rt_ifa'' later" http://cvsweb.openbsd.org/cg

RTM_CHGADDR: route(8)

2018-04-18 Thread Florian Obser
teach route(8) about RTM_CHGADDR OK? diff --git route.c route.c index 9c85f70de78..fee99dcd24b 100644 --- route.c +++ route.c @@ -1257,7 +1257,8 @@ char *msgtypes[] = { "RTM_DESYNC: route socket overflow", "RTM_INVALIDATE: invalidate cache of L2 route", "RTM_BFD: bidirecti

RTM_CHGADDR

2018-04-18 Thread Florian Obser
This is to inform userland (i.e. slaacd(8)) when duplicate address detection finishes. Not a big fan of the lock/unlock dance but I guess it can't be helped for now. Comments, OKs? diff --git net/route.h net/route.h index 3c89348cb43..3d958719049 100644 --- net/route.h +++ net/route.h @@ -241,6

remove unused rtentry parameter from rtm_addr()

2018-04-18 Thread Florian Obser
some dude commited it like this in '95. I came accress it because I want to use it in a place where I don't have a rtentry allocated already. OK? diff --git net/route.c net/route.c index 30c8def301d..a0c5738d831 100644 --- net/route.c +++ net/route.c @@ -1103,7 +1103,7 @@ rt_ifa_add(struct ifadd

re-run DAD on address update

2018-04-18 Thread Florian Obser
Run duplicate address detection again if an existing address gets updated from userland that was marked duplicated or tentative. Otherwise we would just lose the duplicated / tentative state and assume that the address is now unique and usable. OK? diff --git in6.c in6.c index 1c5ec065aa5..b347e

Test wanted: NFS locking (aka beck@ must fix this)

2018-04-18 Thread Martin Pieuchot
Diff below gets rid of the (un)famous XXX in NFS by implementing proper locking for NFS nodes, similar to the inode one. It needs *a lot* of tests. If you run into a problem, try to reproduce it by defining VFSLCKDEBUG and WITNESS in your kernel config file. If that's not enough, you can toggle

Re: fdcopy() w/o memcpy()

2018-04-18 Thread Martin Pieuchot
On 16/04/18(Mon) 12:33, Martin Pieuchot wrote: > Diff below is a rewrite/cleanup of fdcopy() to avoid using memcpy(). > > The problem with the memcpys is that they introduce a window where > some 'struct file *' are duplicated without being refcounted. We > should instead use the following common