* if nfqnl_test utility (libnetfilter_queue) drops a packet the utility receives the packet again
@ 2019-06-28 11:45 Valeri Sytnik
2019-06-28 11:49 ` Florian Westphal
0 siblings, 1 reply; 3+ messages in thread
From: Valeri Sytnik @ 2019-06-28 11:45 UTC (permalink / raw)
To: netfilter-devel
Hello,
Subject:
if nfqnl_test utility ( libnetfilter_queue project ) drops a packet
the utility receives this packet again (in loop)
I faced a very strange problem when trying to use a code from:
https://git.netfilter.org/libnetfilter_queue/tree/utils/nfqnl_test.c
The problem consists in the following:
If all packets are processed as accepted (NF_ACCEPT),
the utility (nfqnl_test) works good,
But if in the utility line:
return nfq_set_verdict(qh, id, NF_ACCEPT, 0, NULL);
I apply NF_DROP (instead NF_ACCEPT) to some tcp packet which
contains some specific string known to me (say, hhhhh)
that packet comes back to the queue again but with different id.
And that happens in the loop: the packet drops again and comes back
again, and so on.
That is interesting that the packet comes back to the queue with frequency
that becomes slower over time.
Also, the above process seems to block other packets (the queue does
not receives other packets).
More details:
(o) To generate tcp packets communications I use simple
tcp server (port 1100) and tcp client that can send a packet with
specific string or a packet without specific string.
(o) To reduce queue traffic I use the following expressions:
iptables -I OUTPUT -p tcp --dport 1100 -j NFQUEUE --queue-bypass
--queue-num 0
or
nft insert rule ip filter output ip protocol tcp tcp dport 1100
counter queue num 0
(o) I tried the platforms: ubuntu 18.04 (kernel 4.15.0)
ubuntu 19.04 (kernel 5.0.0)
ubuntu 12.04 (kernel 3.2.0)
oracle 7.5
All above platforms shows the same behavior with nfqnl_test.
After three weeks of debugging I really need your help.
Thanks.
Valeri
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: if nfqnl_test utility (libnetfilter_queue) drops a packet the utility receives the packet again
2019-06-28 11:45 if nfqnl_test utility (libnetfilter_queue) drops a packet the utility receives the packet again Valeri Sytnik
@ 2019-06-28 11:49 ` Florian Westphal
2019-06-28 16:10 ` Valeri Sytnik
0 siblings, 1 reply; 3+ messages in thread
From: Florian Westphal @ 2019-06-28 11:49 UTC (permalink / raw)
To: Valeri Sytnik; +Cc: netfilter-devel
Valeri Sytnik <valeri.sytnik@gmail.com> wrote:
> I apply NF_DROP (instead NF_ACCEPT) to some tcp packet which
> contains some specific string known to me (say, hhhhh)
> that packet comes back to the queue again but with different id.
Yes, TCP retransmits data that is not received by the peer.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: if nfqnl_test utility (libnetfilter_queue) drops a packet the utility receives the packet again
2019-06-28 11:49 ` Florian Westphal
@ 2019-06-28 16:10 ` Valeri Sytnik
0 siblings, 0 replies; 3+ messages in thread
From: Valeri Sytnik @ 2019-06-28 16:10 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel
Florian, thanks a lot.
I see that a selected tcp packet can not be dropped at all.
If a selected tcp packet is dropped that blocks passing
of next tcp packets via this tcp connection.
Is there way to bypass that?
Thanks a lot.
On 6/28/19, Florian Westphal <fw@strlen.de> wrote:
> Valeri Sytnik <valeri.sytnik@gmail.com> wrote:
>> I apply NF_DROP (instead NF_ACCEPT) to some tcp packet which
>> contains some specific string known to me (say, hhhhh)
>> that packet comes back to the queue again but with different id.
>
> Yes, TCP retransmits data that is not received by the peer.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-06-28 16:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-28 11:45 if nfqnl_test utility (libnetfilter_queue) drops a packet the utility receives the packet again Valeri Sytnik
2019-06-28 11:49 ` Florian Westphal
2019-06-28 16:10 ` Valeri Sytnik
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.