diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2009-03-25 16:52:17 -0400 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2009-03-25 16:52:17 -0400 |
commit | 5c0de29d06318ec8f6e3ba0d17d62529dbbdc1e8 (patch) | |
tree | 8759b27ec098844301343376b600b6ec47b3886f | |
parent | 2732c4e45bb67006fdc9ae6669be866762711ab5 (diff) |
netfilter: nf_conntrack: add generic function to get len of generic policy
Usefull for all protocols which do not add additional data, such
as GRE or UDPlite.
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Signed-off-by: Patrick McHardy <kaber@trash.net>
-rw-r--r-- | include/net/netfilter/nf_conntrack_l4proto.h | 1 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 6 |
2 files changed, 7 insertions, 0 deletions
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index a120990b3b2b..ba32ed7bdabe 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -113,6 +113,7 @@ extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, | |||
113 | const struct nf_conntrack_tuple *tuple); | 113 | const struct nf_conntrack_tuple *tuple); |
114 | extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[], | 114 | extern int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[], |
115 | struct nf_conntrack_tuple *t); | 115 | struct nf_conntrack_tuple *t); |
116 | extern int nf_ct_port_nlattr_tuple_size(void); | ||
116 | extern const struct nla_policy nf_ct_port_nla_policy[]; | 117 | extern const struct nla_policy nf_ct_port_nla_policy[]; |
117 | 118 | ||
118 | #ifdef CONFIG_SYSCTL | 119 | #ifdef CONFIG_SYSCTL |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index c55bbdc7d429..b182b30c7d8d 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -921,6 +921,12 @@ int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[], | |||
921 | return 0; | 921 | return 0; |
922 | } | 922 | } |
923 | EXPORT_SYMBOL_GPL(nf_ct_port_nlattr_to_tuple); | 923 | EXPORT_SYMBOL_GPL(nf_ct_port_nlattr_to_tuple); |
924 | |||
925 | int nf_ct_port_nlattr_tuple_size(void) | ||
926 | { | ||
927 | return nla_policy_len(nf_ct_port_nla_policy, CTA_PROTO_MAX + 1); | ||
928 | } | ||
929 | EXPORT_SYMBOL_GPL(nf_ct_port_nlattr_tuple_size); | ||
924 | #endif | 930 | #endif |
925 | 931 | ||
926 | /* Used by ipt_REJECT and ip6t_REJECT. */ | 932 | /* Used by ipt_REJECT and ip6t_REJECT. */ |