Skip to contentSkip to conversation

IPT_RETURN is not worked in the kernel 2.6.10

DISCUSSION Vincent 1 participant 1 message Sep 22, 2005 netfilter

lore
Share & tools
lore

Vincent

author
#0 lore raw

Sorry, after understanding the meaning of ipt_do_table function. I know currently the IPT_RETURN is only available in the standard target. But I wonder why don't we have the IPT_RETURN in the user defined target?
Can we create a IPT_RETURN in the user defined target. So that we can use the IPT_RETURN in our target to return to the upper chain.

What I mean is "can we port the IPT_RETURN to the user defined target in the ipt_do_table function?"

Vincent

Quoted 41 lines

-----Original Message-----
From: Vincent [mailto:[email protected]]
Sent: Tuesday, September 20, 2005 4:56 PM
To: '[email protected]'
Subject: IPT_RETURN is not worked in the kernel 2.6.10

Hello folks,

I am currently writing a iptables target. And I want to use the IPT_RETURN as the return value from target. But I found that IPT_RETURN will result as NF_ACCEPT does. What I mean is, while I use IPT_RETURN in my target module. It will not go back to the upper directory. Does anyone ever experience the same problem?

Enviroment:
linux kernel 2.6.10
Iptables 1.2.9

Vincent

The following code is part of the ipt_do_table in the ip_tables.c But I don’t know how to modify it to fix the bug? :(

            if (!t->u.kernel.target->target) {
                int v;

                v = ((struct ipt_standard_target *)t)->verdict;
                if (v < 0) {
                    /* Pop from stack? */
                    if (v != IPT_RETURN) {
                        verdict = (unsigned)(-v) - 1;
                        break;
                    }
                    e = back;
                    back = get_entry(table_base,
                             back->comefrom);
                    continue;
                }