From: Andi Kleen <ak@suse.de>
To: Ben Mansell <linux-kernel@slimyhorror.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Selectively refusing TCP connections
Date: Wed, 23 May 2001 20:23:32 +0200 [thread overview]
Message-ID: <20010523202332.A31402@gruyere.muc.suse.de> (raw)
In-Reply-To: <Pine.LNX.4.33.0105231841230.1163-100000@baphomet.bogo.bogus>
In-Reply-To: <Pine.LNX.4.33.0105231841230.1163-100000@baphomet.bogo.bogus>; from linux-kernel@slimyhorror.com on Wed, May 23, 2001 at 06:59:02PM +0100
On Wed, May 23, 2001 at 06:59:02PM +0100, Ben Mansell wrote:
> Hi all,
>
> Is there any mechanism in Linux for refusing incoming TCP connections?
> I'd like to be able to fetch the next incoming connection on a listen
> queue, and selectively accept or reject it based on the IP address of the
> client. I know this could be done via firewall rules, but for this case,
> I'd like an application to have the final say on whether the connection
> will be accepted.
You can push a BPF (LPF) filter expression onto a LISTEN socket that checks
every incoming packet using SO_ATTACH_FILTER.
The only way to do it fully in an application is probably to set up netfilter
NAT to forward the connection to some local process; or alternative push
the packets using a netfilter queue target to a user process and forward/
disable firewall rules dynamically.
-Andi
next prev parent reply other threads:[~2001-05-23 18:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-05-23 17:59 Ben Mansell
2001-05-23 18:23 ` Andi Kleen [this message]
2001-05-24 19:15 ` David Ford
2001-05-24 19:49 ` Andi Kleen
2001-05-23 18:31 ` Alan Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20010523202332.A31402@gruyere.muc.suse.de \
--to=ak@suse.de \
--cc=linux-kernel@slimyhorror.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®