netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen.de>
To: Mojtaba <mespio@gmail.com>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: working with libnetfilter_queue and linbetfilter_contrack
Date: Tue, 18 Jun 2019 11:50:21 +0200	[thread overview]
Message-ID: <20190618095021.doh6pc7gzah3bnra@breakpoint.cc> (raw)
In-Reply-To: <CABVi_Eyws89e+y_4tGJNybGRdL4AarHG6GkNB0d0MGgLABuv3w@mail.gmail.com>

Mojtaba <mespio@gmail.com> wrote:
> I am working for a while on two projects (libnetfilter_queue and
> linbetfilter_contrack) to get the decision of destined of packets that
> arrived in our project. It greats to get the control of all packets.
> But I confused a little.
> In my solution i just want to forward all packets that are in the same
> conditions (for example: all packets are received from specific
> IP:PORT address) to another destination. I could add simply add new
> rule in llinbetfilter_contrack list (like the samples that are exist
> in linbetfilter_contrack/utility project).
> But actually i want to use NFQUEUE to get all packets in my user-space
> and then add new rule in linbetfilter_contrack list. In other words,
> the verdict in my sulotions is not ACCEPT or DROP the packet, it
> should add new rule in linbetfilter_contrack list if it is not exist.
> Is it possible?

Yes, but that doesn't make sense because the kernel will add a conntrack
entry itself if no entry existed.
Or are you dropping packets in NEW state?
Or are you talking about conntrack expectations?

A conntrack entry itself doesn't accept or forward a packet.

It just means that next packet of same flow will find the entry and
rules like iptables ... -m conntrack --ctstate NEW/ESTABLISHED etc.
will match.

  parent reply	other threads:[~2019-06-18  9:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-17  9:42 working with libnetfilter_queue and linbetfilter_contrack Mojtaba
2019-06-18  9:46 ` Mojtaba
2019-06-18  9:50 ` Florian Westphal [this message]
2019-06-18 10:24   ` Mojtaba
     [not found]   ` <CABVi_EyyV6jmB8SxuiUKpHzL9NwMLUA1TPk3X=SOq58BFdG9vA@mail.gmail.com>
2019-06-18 10:56     ` Florian Westphal
     [not found]       ` <CABVi_ExMpOnaau6sroSXd=Zzc4=F6t0Hv5iCm16q0jxqp5Tjkg@mail.gmail.com>
2019-06-18 13:23         ` Florian Westphal
2019-06-18 13:39           ` Mojtaba
2019-06-18 14:00             ` Florian Westphal
2019-06-19  6:50               ` Mojtaba
2019-06-24  8:30                 ` Mojtaba

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=20190618095021.doh6pc7gzah3bnra@breakpoint.cc \
    --to=fw@strlen.de \
    --cc=mespio@gmail.com \
    --cc=netfilter-devel@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;
as well as URLs for NNTP newsgroup(s).