Skip to contentSkip to conversation

iptables: handle IPT_RETURN from user target

PATCH In review Haim Daniel 2 participants 2 messages Mar 18, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iptables: handle IPT_RETURN from user target

This patch handles IPT_RETURN retcode for user's iptables' targets (modules).

Up until now it was handled only for the built-in RETURN iptables' target and IPT_RETURN in a user target resulted in a NF_DROP.

---

net/ipv4/netfilter/ip_tables.c 2009-03-18 14:00:29.000000000 +0200 renamed from net/ipv4/netfilter/ip_tables.c 2009-03-18 14:00:12.000000000 +0200 +5 -0
diff -Nuap a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
@@ -383,6 +383,11 @@ ipt_do_table(struct sk_buff **pskb,
 
                if (verdict == IPT_CONTINUE)
                    e = (void *)e + e->next_offset;
+                else if (verdict == IPT_RETURN) {
+                    e = back;
+                    back = get_entry(table_base,
+                             back->comefrom);
+                }
                else
                    /* Verdict */
                    break;
#1 lore raw
Quoted 4 lines · Haim Daniel

This patch handles IPT_RETURN retcode for user's iptables' targets (modules).

Up until now it was handled only for the built-in RETURN iptables' target and IPT_RETURN in a user target resulted in a NF_DROP.

And what module will be using this?