bpf_catchpacket and bpf_wakeup optimisations

2020-12-27 Thread David Gwynne
now that bpf read timeouts are only handled on the bpfread() side, there's a simplification that can be made in bpf_catchpacket. the chunk in bpf_catchpacket that rotates the buffers when one gets full already does a wakeup, so we don't have to check if we have any waiting readers and wake them up

Re: bpf(4): remove ticks

2020-12-27 Thread David Gwynne
On Sat, Dec 26, 2020 at 04:48:23PM -0600, Scott Cheloha wrote: > Now that we've removed bd_rdStart from the bpf_d struct, removing > ticks from bpf(4) itself is straightforward. > > - bd_rtout becomes a timespec; update bpfioctl() accordingly. > Cap it at MAXTSLP nanoseconds to avoid arithmetic

Re: bgpd: adjust loopback filter for network statements

2020-12-27 Thread Sebastian Benoit
I agree with this. ok benno@ Claudio Jeker(cje...@diehard.n-r-g.com) on 2020.12.23 15:37:02 +0100: > In bgpd statements like > network inet static > or > network rtlabel "exportme" > will skip routes that use 127.0.0.1 as nexthop. This makes sense for > network connected and network s

Re: IPsec IPv6 PMTU

2020-12-27 Thread Alexander Bluhm
On Thu, Dec 24, 2020 at 10:54:59PM +0100, Alexander Bluhm wrote: > It also makes v4 and v6 code look simmilar. If you want, I can > split this for easier review. This is the part of the diff that creates a path MTU host route for IPv6. Basically the code is copied from IPv4 and adapted. Some th

Re: [diff] src/usr.sbin/smtpd: change process names

2020-12-27 Thread gilles
it's slightly different: ca is for "crypto agent" unsure if there's really an interest in renaming internally, furthermore there's a separate crypto API for encrypted queue so not distinguishing between crypto api and crypto agent might be confusing. Gilles December 27, 2020 5:43 PM, "Martijn

Re: smtpd: trim down on filter processes

2020-12-27 Thread Todd C . Miller
On Sun, 27 Dec 2020 18:41:22 +0100, Martijn van Duren wrote: > Because filters use system(3) after forking we get 2 processes for every > filter: one for waiting for system(3) to return and one running the actual > filter. > > Since the extra smtpd process does absolutely nothing we can just as ea

Re: extern int optreset not needed

2020-12-27 Thread Theo de Raadt
Take note this change is fine for modern POSIX systems, but there are earlier systems where unistd.h did not contain these externs. That is why these externs were placed. As such, this change makes the software less portable against such ancient systems. At this point, I'm fine with that. Jan

Re: extern int optreset not needed

2020-12-27 Thread Jan Stary
On Dec 26 23:24:57, h...@stare.cz wrote: > ftpd doesn't need to declare extern int optreset > as that is already done in the included unistd.h Here's more for usr.sbin/, if desirable. Jan Index: usr.sbin//amd/amd/get_args.c ===

Re: smtpd: trim down on filter processes

2020-12-27 Thread Martijn van Duren
On Sun, 2020-12-27 at 11:18 -0700, Theo de Raadt wrote: > fork_filter_process() does not feel like the right name for > the function anymore. > Why not? Right now we do fork and call system system in the child. With my diff we move to fork -> exec The fork part is most definitely still there. Or

Re: smtpd: trim down on filter processes

2020-12-27 Thread Theo de Raadt
fork_filter_process() does not feel like the right name for the function anymore. Take note the exit value of the process (as seen by wait elsewhere) will be subtly differe after this conversion from system() to execve(). Upon failure, rather than being 127, it is now 1. Martijn van Duren wrote:

smtpd: trim down on filter processes

2020-12-27 Thread Martijn van Duren
Because filters use system(3) after forking we get 2 processes for every filter: one for waiting for system(3) to return and one running the actual filter. Since the extra smtpd process does absolutely nothing we can just as easily copy over what system(3) does internally for execve and call the s

Revise fd close notification for kqueue-based select(2) and poll(2)

2020-12-27 Thread Visa Hankala
This patch revises the way how kqueue notifies select(2) about the closing of monitored file descriptors. Instead of returning EBADF through kqueue_scan(), the error is conveyed in struct kevent. This is excessive for select(2) but should be useful with kqueue-based poll(2). The idea is the follow

Re: [diff] src/usr.sbin/smtpd: change process names

2020-12-27 Thread Martijn van Duren
In that case fine by me. Anyone else want to chime in? On Sun, 2020-12-27 at 17:04 +, gil...@poolp.org wrote: > it's slightly different: > > ca is for "crypto agent" unsure if there's really an interest in renaming > internally, > furthermore there's a separate crypto API for encrypted queue

Re: [diff] src/usr.sbin/smtpd: change process names

2020-12-27 Thread Martijn van Duren
This one reads OK to me, with one minor bikeshed: You rename klondike to crypto, but the internals still refer to CA everywhere. Wouldn't it be cleaner to leave klondike in step one and do a s/CA/CRYPTO/ in a second step so everything is in concent? Personally I prefer the name crypto over ca. mar

ping(8): flood ping and counts

2020-12-27 Thread Florian Obser
I tried to fix this before in 2018. Claudio had pointed out that a flood ping with a count given would wait forever on a lossy link so we made sure a timeout was set. However we would also exit after the first answer received if we had already send out all flood pings. Flooding something in faraw

Re: pool(9): remove ticks (attempt 2)

2020-12-27 Thread dlg
> On 24 Dec 2020, at 3:16 am, Scott Cheloha wrote: > > On Fri, Dec 11, 2020 at 05:32:54PM -0600, Scott Cheloha wrote: >> On Fri, Dec 11, 2020 at 07:52:45PM +0100, Mark Kettenis wrote: Date: Fri, 11 Dec 2020 11:51:54 -0600 From: Scott Cheloha On Fri, Dec 11, 2020 at 09:49:

Re: extern int optreset not needed

2020-12-27 Thread Martijn van Duren
OK martijn@ On Sat, 2020-12-26 at 23:24 +0100, Jan Stary wrote: > ftpd doesn't need to declare extern int optreset > as that is already done in the included unistd.h > > Jan > > Index: popen.c > === > RCS file: /cvs/src/libe