🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.openbsd-pf
Article #101

synproxy and RST (non-listener)

#101
From: Nerius Landys
Date: Wed, 20 Oct 2010 19:39
33 lines
2155 bytes
I'm using synproxy in my pf.conf:

pass in on em0 proto tcp from any to any port = XXXX flags S/SA  \
   synproxy state (source-track rule, max-src-conn 36, if-bound)

This basically limits the number of TCP connections ("something in the
pf state table") from a single IP address to 36.

Now if no process is actually listening on port XXXX, and when a remote
host tries to connect to port XXXX, they never get an RST response
(I _believe_ that this is what's going on).

For example, if port XXXX is port 80 for http, and I point Firefox to
port 80 (when no Apache is running), I get the hourglass for a minute
after which "Connection Interrupted
The connection to the server was reset while the page was loading" in
Firefox.

When I point Firefox to a port that is _not_ in the synproxy rule and
when no service is running on that port, Firefox responds immediately
with "Failed to Connect
Firefox can't establish a connection to the server...".

So whatever the TCP packet is that means "this port is not listening",
it's not being sent by the synproxy when there is no service listening
on that port.

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?

Thanks.
Technical Details
Message-ID: <Pine.LNX.4.63.1010202201390.29542@roadrunner.metaflex.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!newsgate.newsguy.com!newsp.newsguy.com!mdrn

Show Full Headers
Complete Article Headers
X-Google-Thread: bffa70e3,5f9bda23cab0e01d,start
X-Google-Attributes: gidbffa70e3,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!newsgate.newsguy.com!newsp.newsguy.com!mdrn
From: landys@nerius.com (Nerius Landys)
Newsgroups: bit.listserv.openbsd-pf
Subject: synproxy and RST (non-listener)
Date: 20 Oct 2010 12:39:18 -0700
Organization: None
Lines: 33
Message-ID: <Pine.LNX.4.63.1010202201390.29542@roadrunner.metaflex.com>
NNTP-Posting-Host: localhost
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
NNTP-Posting-Date: 20 Oct 2010 19:39:19 GMT