IPT_RETURN is not worked in the kernel 2.6.10
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_RETURNis not worked in the kernel 2.6.10Hello folks,
I am currently writing a iptables target. And I want to use the
IPT_RETURNas the return value from target. But I found thatIPT_RETURNwill result asNF_ACCEPTdoes. What I mean is, while I useIPT_RETURNin 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.9Vincent
The following code is part of the
ipt_do_tablein theip_tables.cBut 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; }
Quoted 7 lines · Vincent
Sorry, after understanding the meaning of
ipt_do_tablefunction. I know currently theIPT_RETURNis only available in the standard target. But I wonder why don't we have theIPT_RETURNin the user defined target?Can we create a
IPT_RETURNin the user defined target. So that we can use theIPT_RETURNin our target to return to the upper chain.
I don't see that much of a problem with it. It should work if you copy the "if (v != IPT_RETURN)" block from the "if (!t->u.kernel.target->target)" block to the "else" section.
Please test and submit a proposed patch.
And please don't repost your messages thrice to this list, thanks.
Signature · 5 lines
- Harald Welte <[email protected]> http://netfilter.org/ ============================================================================ "Fragmentation is like classful addressing -- an interesting early architectural error that shows how much experimentation was going on while IP was being designed." -- Paul Vixie