From: Holger Eitzenberger <holger@eitzenberger.org>
To: Patrick McHardy <kaber@trash.net>
Cc: pablo@netfilter.org, netfilter-devel@vger.kernel.org,
netdev@vger.kernel.org
Subject: [patch 2/3] netfilter: add generic function to get len of generic policy
Date: Wed, 25 Mar 2009 21:34:06 +0100 [thread overview]
Message-ID: <20090325204601.730465387@jonathan.eitzenberger.org> (raw)
In-Reply-To: 20090325203404.581023828@jonathan.eitzenberger.org
[-- Attachment #1: netfilter-add-generic-fn-for-generic-policy.diff --]
[-- Type: text/plain, Size: 1324 bytes --]
Usefull for all protocols which do not add additional data, such
as GRE or UDPlite.
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Index: nf-next-2.6/include/net/netfilter/nf_conntrack_l4proto.h
===================================================================
--- nf-next-2.6.orig/include/net/netfilter/nf_conntrack_l4proto.h
+++ nf-next-2.6/include/net/netfilter/nf_conntrack_l4proto.h
@@ -113,6 +113,7 @@ extern int nf_ct_port_tuple_to_nlattr(st
const struct nf_conntrack_tuple *tuple);
extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[],
struct nf_conntrack_tuple *t);
+extern int nf_ct_port_nlattr_tuple_size(void);
extern const struct nla_policy nf_ct_port_nla_policy[];
#ifdef CONFIG_SYSCTL
Index: nf-next-2.6/net/netfilter/nf_conntrack_core.c
===================================================================
--- nf-next-2.6.orig/net/netfilter/nf_conntrack_core.c
+++ nf-next-2.6/net/netfilter/nf_conntrack_core.c
@@ -906,6 +906,12 @@ int nf_ct_port_nlattr_to_tuple(struct nl
return 0;
}
EXPORT_SYMBOL_GPL(nf_ct_port_nlattr_to_tuple);
+
+int nf_ct_port_nlattr_tuple_size(void)
+{
+ return nla_policy_len(nf_ct_port_nla_policy, CTA_PROTO_MAX + 1);
+}
+EXPORT_SYMBOL_GPL(nf_ct_port_nlattr_tuple_size);
#endif
/* Used by ipt_REJECT and ip6t_REJECT. */
--
next prev parent reply other threads:[~2009-03-25 20:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-25 20:34 [patch 0/3] ctnetlink: allocation improvements Holger Eitzenberger
2009-03-25 20:34 ` [patch 1/3] ctnetlink: allocate right-sized ctnetlink skb Holger Eitzenberger
2009-03-25 20:51 ` Patrick McHardy
2009-03-25 20:34 ` Holger Eitzenberger [this message]
2009-03-25 20:53 ` [patch 2/3] netfilter: add generic function to get len of generic policy Patrick McHardy
2009-03-25 20:34 ` [patch 3/3] netfilter: calculate per-protocol nlattr size Holger Eitzenberger
2009-03-25 20:54 ` Patrick McHardy
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=20090325204601.730465387@jonathan.eitzenberger.org \
--to=holger@eitzenberger.org \
--cc=kaber@trash.net \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).