Patchwork [2/3] netfilter: add generic function to get len of generic policy

login
register
mail settings
Submitter holger@eitzenberger.org
Date March 25, 2009, 8:34 p.m.
Message ID <20090325204601.730465387@jonathan.eitzenberger.org>
Download mbox | patch
Permalink /patch/25102/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

holger@eitzenberger.org - March 25, 2009, 8:34 p.m.
Usefull for all protocols which do not add additional data, such
as GRE or UDPlite.

Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Patrick McHardy - March 25, 2009, 8:53 p.m.
Holger Eitzenberger wrote:
> Usefull for all protocols which do not add additional data, such
> as GRE or UDPlite.

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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. */