From: AFT <aftnix@gmail.com>
To: netfilter-devel@vger.kernel.org
Subject: What happened to xt_match_param
Date: Tue, 03 Jul 2012 19:46:51 +0600 [thread overview]
Message-ID: <mx3hez3o.fsf@s1.test.com> (raw)
Hi,
In "writing netfilter module", by JAN, there is a inconsistancy in
section 2.5 named "Point of decision".
Here a match function is prototyped as ,
struct bool ipaddr_mt(const struct sk_buff *skb,
struct xt_match_param *par);
Now there is no xt_match_param in netfilter.h. The closest thing is
'struct xt_mtchk_param'. which is defined as,
struct xt_mtchk_param {
struct net *net;
const char *table;
const void *entryinfo;
const struct xt_match *match;
void *matchinfo;
unsigned int hook_mask;
u_int8_t family;
};
So at first i thought i can just replace it with xt_mtchk_param. But the
problem is the text reads following lines which can not be right if i
replace xt_match_param with xt_mtchk_param.
par->in and par->out supposed to point to IN or OUT network devices. but
as you can see there is no such fields in xt_mtchk_param.
These struct net_device *in,out fields are inside struct
xt_action_param.
struct xt_action_param{
...........
struct net_device *in,*out;
...........
}
After subsequent reading i understood, it should be struct
xt_action_param in the match function's prototype. so the correct
prototype should be,
static bool ipaddr_mt(const struct sk_buff *skb,
struct xt_action_param *par);
So it should be updated so that noobs like me does not get confused.
cheers
aft
next reply other threads:[~2012-07-03 13:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-03 13:46 AFT [this message]
2012-07-03 15:03 ` What happened to xt_match_param AFT
2012-07-03 15:57 ` Jan Engelhardt
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=mx3hez3o.fsf@s1.test.com \
--to=aftnix@gmail.com \
--cc=netfilter-devel@vger.kernel.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.