From: Padam J Singh <me@padamj.com>
To: netfilter-devel@lists.netfilter.org
Subject: New Target related query.
Date: Tue, 28 Sep 2004 17:01:38 +0530 [thread overview]
Message-ID: <41594B9A.5080201@padamj.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]
Hi all,
I have written a new iptables target. I followed the regular method of
registering a new target by the following:
ipt_register_target(...) with a struct like this:
static struct ipt_target ipt_xyz_reg = { { NULL, NULL }, "XYZ",
ipt_xyz_target, ipt_xyz_checkentry, ipt_xyz_destroy,THIS_MODULE };
From the userspace, when I create sample rule 1:
iptables -I INPUT -s 172.16.0.1 -j XYZ --param 5
the following functions get called:
ipt_xyz_checkentry. with target info struct populated with 5
the function saves the param in a list and returns 1.
When I create rule 2:
iptables -I INPUT -s 172.16.0.2 -j XYZ --param 6
the following get called:
ipt_xyz_checkentry. with target info struct populated with 6
//the function saves the param in a list and returns 1.
ipt_xyz_checkentry. with target info struct populated with 5
//the function does not save 5 in the list as it already exists and
returns 1.
ipt_xyz_destroy. with target info struct populated with 5
//the function removes 5 from the list and returns 1.
I was expecting that ipt_xyz_checkentry will be called whenever I create
a new rule. It seems to call checkentry even for existing rules for
target XYZ.
I can handle that, however, it also calls destroy, with no user space
request to delete the rule!
I fail to understand what the issue maybe. How can I stop iptables to
stop calling the checkentry function for pre-exising rules, and if that
can't be done, how do i stop it from calling the destroy function on
it's own.
I am using iptables ver 1.2.11 on kernel 2.4.18-3.
Please help!
Padam Singh.
reply other threads:[~2004-09-28 11:31 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41594B9A.5080201@padamj.com \
--to=me@padamj.com \
--cc=netfilter-devel@lists.netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.