Article View: bit.listserv.openbsd-pf
Article #103Re: synproxy and RST (non-listener)
From: Henning Brauer
Date: Thu, 21 Oct 2010 10:47
Date: Thu, 21 Oct 2010 10:47
42 lines
2833 bytes
2833 bytes
* Nerius Landys <landys@nerius.com> [2010-10-20 22:30]: > >Is there a way to get synproxy to send the RST (I _think_ that's what it > >is called) when no service is running on that port? Or is this a feature? > >Or is there a reason it behaves this way? Intentional, bug, oversight, > >or missing modifier to my rule? > > Hrm I think, after doing a little bit more research, I understand why this > isn't possible. Maybe you can tell me if I'm right. Seems that > synproxy completes a TCP connect handshake completely with the client > before even sending anything to the actual service it's proxying. > This is the whole purpose of synproxy. So, it has a completed handshake, > the client thinks he's "connected", and pf tries to "connect" to the > underlying service, but receives an RST or whatnot, which means > the service isn't running. It's probably too late to send an RST > to the client at this point, so pf just lets the connection from the > client "hang". that's about right > I suppose there's not way to get around this problem... right. > Maybe ask the operating system if the port is "bound" before completing > the handshake with the client, otherwise send RST to the client? askin before isn't possible. you do not know that the backend will accept a connection based on a previous connection being accepted. and doing a check before replying with a syn defeats the prupose anyway. sending an RST back if the backend doesn't accept the connection, well, we could do that, but it still doesn't solve anything - clients treat "established connection terminated" very differently then "connection not accepted". there is no way to "solve" this. synproxy is not for everyday use. -- Henning Brauer, hb@bsws.de, henning@openbsd.org BS Web Services, http://bsws.de Full-Service ISP - Secure Hosting, Mail and DNS Services Dedicated Servers, Rootservers, Application Hosting
Technical Details
Message-ID:
<20101020204241.GC9856@nudo.bsws.de>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!newsgate.newsguy.com!newsp.newsguy.com!mdrnReferences:
<Pine.LNX.4.63.1010202201390.29542@roadrunner.metaflex.com> <Pine.LNX.4.63.1010202258110.30642@roadrunner.metaflex.com>Show Full Headers
Complete Article Headers
X-Google-Thread: ff4ef,5f9bda23cab0e01d X-Google-NewGroupId: yes X-Google-Attributes: gidbffa70e3,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!newsgate.newsguy.com!newsp.newsguy.com!mdrn From: henning@openbsd.org (Henning Brauer) Newsgroups: bit.listserv.openbsd-pf Subject: Re: synproxy and RST (non-listener) Date: 21 Oct 2010 03:47:26 -0700 Organization: None Lines: 42 Message-ID: <20101020204241.GC9856@nudo.bsws.de> References: <Pine.LNX.4.63.1010202201390.29542@roadrunner.metaflex.com> <Pine.LNX.4.63.1010202258110.30642@roadrunner.metaflex.com> NNTP-Posting-Host: localhost.newsguy.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Date: 21 Oct 2010 10:47:26 GMT