netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nayan Gadre <beejoy.nayan@gmail.com>
To: netfilter@vger.kernel.org
Subject: Fwd: nfqueue at postrouting hook does not work
Date: Tue, 21 Nov 2023 00:00:39 +0530	[thread overview]
Message-ID: <CABTgHBt3qAxLf9kYg3TjUbges1yUKnMAL0okcr=W9s=v1KhWfg@mail.gmail.com> (raw)
In-Reply-To: <CABTgHBtq5LGLoERAXzhNsoQCjsQSHrLq5Zn+1=U5Gukxc+qWMg@mail.gmail.com>

Kernel 4.4.60. nft ver: 0.9.6

Hi,

I am trying to send packets to a user space application using nfqueue.
I added the following chain and rule.
table ip hotspot {
        chain nchain { # handle 3
                type filter hook postrouting priority 400; policy accept;
                udp sport 53 counter packets 71 bytes 38194 queue num
43 bypass # handle
                udp dport 53 counter packets 73 bytes 5184 queue num
43 bypass # handle 33
        }
}

The counter increments but the application does not receive the packets.

If I try at a different hook position then the application receives it.
table ip hotspot {
        chain dns-snoop-forward { # handle 2
                type filter hook forward priority raw; policy accept;
                udp sport 53 counter packets 23 bytes 12951 queue num
43 bypass #
                udp dport 53 counter packets 28 bytes 2031 queue num
43 bypass # handle
        }
}

1. Does post routing hook not allow nfqueue ?
2. Also Is it possible to send packets to userspace after the
_nf_conntrack_confirm() has confirmed the ct. I tried to change the
static priority of NF_IP_PRI_CONNTRACK_CONFIRM to 350 and added my
hook at 400, but packets were not received by userspace. Anything I am
missing.

Kindly suggest.

Thanks
ngadre

      reply	other threads:[~2023-11-20 18:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-20 18:17 nfqueue at postrouting hook does not work Nayan Gadre
2023-11-20 18:30 ` Nayan Gadre [this message]

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='CABTgHBt3qAxLf9kYg3TjUbges1yUKnMAL0okcr=W9s=v1KhWfg@mail.gmail.com' \
    --to=beejoy.nayan@gmail.com \
    --cc=netfilter@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 read-only IMAP folder(s) and NNTP newsgroup(s).