All of lore.kernel.org
 help / color / mirror / Atom feed
* How can i leave a packet to continue the iptables ruleset checking?
@ 2008-12-23 21:02 ilninno
  2009-01-01 20:55 ` ilninno
  2009-01-12  5:10 ` Patrick McHardy
  0 siblings, 2 replies; 4+ messages in thread
From: ilninno @ 2008-12-23 21:02 UTC (permalink / raw)
  To: netfilter-devel

Hello! I have some problems with netfilter_queue:

I created a queue and registered my c program, when a packet matchs
with the iptables rules my code get the event. i usually return
NF_ACCEPT and NF_DROP, but sometimes i need to leave the packet to
continue with iptables rules checking, i tried with:

1- Using NF_QUEUE: WIth this option the packet enter again in iptables
rules (from rule 1 to NFQUEUE rule), but i only want to check (from
NFQUEUE rule to end).


rule:   $IPTABLES -A OUTPUT -m state --state NEW -j NFQUEUE --queue-num 0



How can i leave the packet to continue in iptables ruleset without
beginning again?  Thanks for your time.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* How can i leave a packet to continue the iptables ruleset checking?
  2008-12-23 21:02 How can i leave a packet to continue the iptables ruleset checking? ilninno
@ 2009-01-01 20:55 ` ilninno
  2009-01-01 23:12   ` Eric Leblond
  2009-01-12  5:10 ` Patrick McHardy
  1 sibling, 1 reply; 4+ messages in thread
From: ilninno @ 2009-01-01 20:55 UTC (permalink / raw)
  To: netfilter-devel

Hello! I have some problems with netfilter_queue:

I created a queue and registered my c program, when a packet matchs
with the iptables rules my code get the event. i usually return
NF_ACCEPT and NF_DROP, but sometimes i need to leave the packet to
continue with iptables rules checking, i tried with:

1- Using NF_QUEUE: WIth this option the packet enter again in iptables
rules (from rule 1 to NFQUEUE rule), but i only want to check (from
NFQUEUE rule to end).


rule:   $IPTABLES -A OUTPUT -m state --state NEW -j NFQUEUE --queue-num 0



How can i leave the packet to continue in iptables ruleset without
beginning again?  Thanks for your time.


Please, someone can help me

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How can i leave a packet to continue the iptables ruleset checking?
  2009-01-01 20:55 ` ilninno
@ 2009-01-01 23:12   ` Eric Leblond
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Leblond @ 2009-01-01 23:12 UTC (permalink / raw)
  To: ilninno; +Cc: netfilter-devel

[-- Attachment #1: Type: text/plain, Size: 1092 bytes --]

Hi,

Le jeudi 01 janvier 2009 à 21:55 +0100, ilninno a écrit :
> Hello! I have some problems with netfilter_queue:
> 
> I created a queue and registered my c program, when a packet matchs
> with the iptables rules my code get the event. i usually return
> NF_ACCEPT and NF_DROP, but sometimes i need to leave the packet to
> continue with iptables rules checking, i tried with:
> 
> How can i leave the packet to continue in iptables ruleset without
> beginning again?  Thanks for your time.

You really can't. The only known workaround is to send the NF_REPEAT
verdict and mark the packet. The mark can then be used to "jump" to the
correct rule.

This is not really nice but it works.

I've recently cooked a patch for snort-inline using this method:
http://sourceforge.net/mailarchive/forum.php?thread_name=1228209364-7798-1-git-send-email-eric%40inl.fr&forum_name=snort-inline-users

The method seems to work quiet well but it may not be suitable for more
complex cases.

BR,
-- 
Eric Leblond <eric@inl.fr>
INL: http://www.inl.fr/
NuFW: http://www.nufw.org/

[-- Attachment #2: Ceci est une partie de message numériquement signée --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How can i leave a packet to continue the iptables ruleset checking?
  2008-12-23 21:02 How can i leave a packet to continue the iptables ruleset checking? ilninno
  2009-01-01 20:55 ` ilninno
@ 2009-01-12  5:10 ` Patrick McHardy
  1 sibling, 0 replies; 4+ messages in thread
From: Patrick McHardy @ 2009-01-12  5:10 UTC (permalink / raw)
  To: ilninno; +Cc: netfilter-devel

ilninno wrote:
> Hello! I have some problems with netfilter_queue:
> 
> I created a queue and registered my c program, when a packet matchs
> with the iptables rules my code get the event. i usually return
> NF_ACCEPT and NF_DROP, but sometimes i need to leave the packet to
> continue with iptables rules checking, i tried with:
> 
> 1- Using NF_QUEUE: WIth this option the packet enter again in iptables
> rules (from rule 1 to NFQUEUE rule), but i only want to check (from
> NFQUEUE rule to end).
> 
> 
> rule:   $IPTABLES -A OUTPUT -m state --state NEW -j NFQUEUE --queue-num 0
> 
> 
> 
> How can i leave the packet to continue in iptables ruleset without
> beginning again?  Thanks for your time.

You can use NF_REPEAT to enter the same chain again and mark
the packet to skip the first rules or jump to a seperate chain.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-01-12  5:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-23 21:02 How can i leave a packet to continue the iptables ruleset checking? ilninno
2009-01-01 20:55 ` ilninno
2009-01-01 23:12   ` Eric Leblond
2009-01-12  5:10 ` Patrick McHardy

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.