Re: Fix for connect race in relayd

2015-06-11 Thread sven falempin
Dear relayd user, I am glad there is a connection state in relayd, this sound a better design, the former patch proposed by B.Provost was already a step toward this. This State is also a good tool to remove the volatile inflight; Fixing the race condition the OP was working on. Should we (I) pro

Re: Fix for connect race in relayd

2015-05-31 Thread Alexander Bluhm
On Sat, May 30, 2015 at 01:40:24PM +0200, Claudio Jeker wrote: > New version that now passes all regress tests. It got a fair bit more > complex because the F_TLSINSPECT case results in multiple entries of > relay_connect and relay_connected. So I switched to use a state variable > instead of a fla

Re: Fix for connect race in relayd

2015-05-31 Thread sven falempin
On Sun, May 31, 2015 at 1:33 PM, sven falempin wrote: > > On Sun, May 31, 2015 at 8:40 AM, Reyk Floeter wrote: > >> On Sat, May 30, 2015 at 11:18:59PM -0400, sven falempin wrote: >> > The patch is in a turned off machine, >> > after doing the patch >> > i contacted directly reyk for the matter,

Re: Fix for connect race in relayd

2015-05-31 Thread sven falempin
On Sun, May 31, 2015 at 8:40 AM, Reyk Floeter wrote: > On Sat, May 30, 2015 at 11:18:59PM -0400, sven falempin wrote: > > The patch is in a turned off machine, > > after doing the patch > > i contacted directly reyk for the matter, > > i d like to push the issue further by not accepting > > the s

Re: Fix for connect race in relayd

2015-05-31 Thread Alexander Hall
On May 31, 2015 3:15:33 PM GMT+02:00, Gleydson Soares wrote: >> (The pastebin expire) > >patches on tech@ are preferably as inline(text/plain) in the body of >the email. >and make sure that your mail client doesn't corrupt it. > >most openbsd developers uses mutt, > >but there are a lot of MUAs

Re: Fix for connect race in relayd

2015-05-31 Thread Gleydson Soares
> (The pastebin expire) patches on tech@ are preferably as inline(text/plain) in the body of the email. and make sure that your mail client doesn't corrupt it. most openbsd developers uses mutt, but there are a lot of MUAs that handle correctly inline content disposition without mangling the dif

Re: Fix for connect race in relayd

2015-05-31 Thread Reyk Floeter
On Sat, May 30, 2015 at 11:18:59PM -0400, sven falempin wrote: > The patch is in a turned off machine, > after doing the patch > i contacted directly reyk for the matter, > i d like to push the issue further by not accepting > the socket while the connect didnt succeed when possible. > > (The past

Re: Fix for connect race in relayd

2015-05-30 Thread sven falempin
The patch is in a turned off machine, after doing the patch i contacted directly reyk for the matter, i d like to push the issue further by not accepting the socket while the connect didnt succeed when possible. (The pastebin expire) Please be a bit patient. On Sat, May 30, 2015 at 12:35 PM, Th

Re: Fix for connect race in relayd

2015-05-30 Thread Theo de Raadt
> it is possible to remove the inflight var by opening the socket before > accepting. > Thus there is no need for guessing if the peer socket can be open, Where is your diff to demonstrate this? Show your work. (Or we'll have to make an assumption).

Re: Fix for connect race in relayd

2015-05-30 Thread Claudio Jeker
On Sat, May 30, 2015 at 10:27:49AM -0400, sven falempin wrote: > it is possible to remove the inflight var by opening the socket before > accepting. > Thus there is no need for guessing if the peer socket can be open, How should that work when HTTP headers of the request determine to which system

Re: Fix for connect race in relayd

2015-05-30 Thread sven falempin
it is possible to remove the inflight var by opening the socket before accepting. Thus there is no need for guessing if the peer socket can be open, On Sat, May 30, 2015 at 7:40 AM, Claudio Jeker wrote: > On Fri, May 22, 2015 at 09:18:29PM +0200, Alexander Bluhm wrote: > > This breaks relayd wit

Re: Fix for connect race in relayd

2015-05-30 Thread Claudio Jeker
On Fri, May 22, 2015 at 09:18:29PM +0200, Alexander Bluhm wrote: > This breaks relayd with TLS inspection. Moving down the "called > once" check after the F_TLSINSPECT block fixes the plain SSL case. > But HTTPS still hangs. I have just commited a test. Try > > cd /usr/src/regress/usr.sbin/rela

Re: Fix for connect race in relayd

2015-05-22 Thread Alexander Bluhm
This breaks relayd with TLS inspection. Moving down the "called once" check after the F_TLSINSPECT block fixes the plain SSL case. But HTTPS still hangs. I have just commited a test. Try cd /usr/src/regress/usr.sbin/relayd && make run-regress-args-https-inspect.pl bluhm On Fri, May 22, 2015 a

Fix for connect race in relayd

2015-05-22 Thread Claudio Jeker
On our production systems we did hit the "relay_connect: no connection in flight" on a so regular bases that I had to make it non-fatal with the result of leaking sockets. After more investigation I found the problem to be a race against connecting to the backend servers. In short: - relay_read_ht