: Netfilter update
Subsystems (3)
cover : Netfilter update
Hi Dave,
following is a netfilter update for 2.6.24, containing a set of patches to use the generic netlink functions for nfnetlink, a new "time" match, some nfnetlink_log cleanups and some minor other stuff.
Please apply, thanks.
include/linux/netfilter/Kbuild | 1 + include/linux/netfilter/nfnetlink.h | 98 +---- include/linux/netfilter/nfnetlink_compat.h | 61 +++ include/linux/netfilter/nfnetlink_conntrack.h | 1 + include/linux/netfilter/xt_time.h | 25 ++ include/net/netfilter/nf_conntrack.h | 3 - include/net/netfilter/nf_conntrack_expect.h | 3 - include/net/netfilter/nf_conntrack_helper.h | 2 +- include/net/netfilter/nf_conntrack_l3proto.h | 9 +- include/net/netfilter/nf_conntrack_l4proto.h | 17 +- include/net/netfilter/nf_nat_protocol.h | 8 +- net/bridge/br_netfilter.c | 5 - net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 30 +- net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 40 +- net/ipv4/netfilter/nf_nat_core.c | 22 +- net/ipv4/netfilter/nf_nat_proto_gre.c | 4 +- net/ipv4/netfilter/nf_nat_proto_icmp.c | 4 +- net/ipv4/netfilter/nf_nat_proto_tcp.c | 4 +- net/ipv4/netfilter/nf_nat_proto_udp.c | 4 +- net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 30 +- net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 40 +- net/netfilter/Kconfig | 14 + net/netfilter/Makefile | 1 + net/netfilter/nf_conntrack_core.c | 33 +- net/netfilter/nf_conntrack_expect.c | 2 - net/netfilter/nf_conntrack_netlink.c | 551 +++++++++++++----------- net/netfilter/nf_conntrack_proto_gre.c | 5 +- net/netfilter/nf_conntrack_proto_tcp.c | 87 ++-- net/netfilter/nf_conntrack_proto_udp.c | 10 +- net/netfilter/nf_conntrack_proto_udplite.c | 10 +- net/netfilter/nfnetlink.c | 106 +---- net/netfilter/nfnetlink_log.c | 221 +++++------ net/netfilter/nfnetlink_queue.c | 133 +++--- net/netfilter/xt_time.c | 269 ++++++++++++ 34 files changed, 1052 insertions(+), 801 deletions(-) create mode 100644 include/linux/netfilter/nfnetlink_compat.h create mode 100644 include/linux/netfilter/xt_time.h create mode 100644 net/netfilter/xt_time.c
Jan Engelhardt (1):
[NETFILTER]: x_tables: add xt_time match
Joseph Fannin (1):
[NETFILTER]: bridge: remove broken netfilter binary sysctls
Michal Miroslaw (5):
[NETFILTER]: nfnetlink_log: kill duplicate code [NETFILTER]: nfnetlink_log: flush queue early [NETFILTER]: nfnetlink_log: fix style
[NETFILTER]: nfnetlink_log: fix instance_create() failure path [NETFILTER]: nfnetlink_log: fix some constants
Pablo Neira Ayuso (1):
[NETFILTER]: nf_conntrack_netlink: add support to related connections
Patrick McHardy (11):
[NETFILTER]: nfnetlink: make subsystem and callbacks const [NETFILTER]: nfnetlink: convert to generic netlink attribute functions [NETFILTER]: nfnetlink: rename functions containing 'nfattr' [NETFILTER]: nfnetlink: use nlmsg_notify()
[NETFILTER]: nfnetlink: support attribute policies [NETFILTER]: nfnetlink_log: use netlink policy [NETFILTER]: nfnetlink_queue: use netlink policy [NETFILTER]: ctnetlink: use netlink policy
[NETFILTER]: nfnetlink: kill nlattr_bad_size
[NETFILTER]: nf_conntrack: kill unique ID
[NETFILTER]: nf_conntrack_expect: kill unique ID
PATCH 1/19 : nfnetlink: make subsystem and callbacks const
[NETFILTER]: nfnetlink: make subsystem and callbacks const
---
commit 03d16f1357128ee213012f18911a3cdabc353c13
tree 6f47576a432955e809f9a31451c5dd0cd2afc173
parent 90fdec8facd917c630743d205b60c275e419d3e3
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 17:18:21 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 17:18:21 +0200
include/linux/netfilter/nfnetlink.h | 10 +++++----- net/netfilter/nf_conntrack_netlink.c | 8 ++++---- net/netfilter/nfnetlink.c | 18 +++++++++--------- net/netfilter/nfnetlink_log.c | 4 ++-- net/netfilter/nfnetlink_queue.c | 4 ++-- 5 files changed, 22 insertions(+), 22 deletions(-)
include/linux/netfilter/nfnetlink.h +5 -5
@@ -118,9 +118,9 @@ struct nfnl_callbackstruct nfnetlink_subsystem {const char *name; -__u8 subsys_id;/* nfnetlink subsystem ID */ -__u8 cb_count;/* number of callbacks */ -struct nfnl_callback *cb;/* callback for individual types */ +__u8 subsys_id;/* nfnetlink subsystem ID */ +__u8 cb_count;/* number of callbacks */ +const struct nfnl_callback *cb;/* callback for individual types */ }; extern void __nfa_fill(struct sk_buff *skb, int attrtype,
@@ -129,8 +129,8 @@ extern void __nfa_fill(struct sk_buff *skb, int attrtype, ({if (skb_tailroom (skb) < (int )NFA_SPACE (attrlen)) goto nfattr_failure; \ __nfa_fill(skb, attrtype, attrlen, data); }) -extern int nfnetlink_subsys_register (struct nfnetlink_subsystem *n); -extern int nfnetlink_subsys_unregister (struct nfnetlink_subsystem *n); +extern int nfnetlink_subsys_register (const struct nfnetlink_subsystem *n); +extern int nfnetlink_subsys_unregister (const struct nfnetlink_subsystem *n);extern void nfattr_parse (struct nfattr *tb[],int maxattr,struct nfattr *nfa,int len);
net/netfilter/nf_conntrack_netlink.c +4 -4
@@ -1548,7 +1548,7 @@ static struct notifier_block ctnl_notifier_exp = { };#endif -static struct nfnl_callback ctnl_cb[IPCTNL_MSG_MAX ] = { +static const struct nfnl_callback ctnl_cb[IPCTNL_MSG_MAX ] = { [IPCTNL_MSG_CT_NEW ] = { .call = ctnetlink_new_conntrack, .attr_count =CTA_MAX , }, [IPCTNL_MSG_CT_GET ] = { .call = ctnetlink_get_conntrack,
@@ -1559,7 +1559,7 @@ static struct nfnl_callback ctnl_cb[IPCTNL_MSG_MAX] = { .attr_count = CTA_MAX, }, }; -static struct nfnl_callback ctnl_exp_cb[IPCTNL_MSG_EXP_MAX ] = { +static const struct nfnl_callback ctnl_exp_cb[IPCTNL_MSG_EXP_MAX ] = { [IPCTNL_MSG_EXP_GET ] = { .call = ctnetlink_get_expect, .attr_count =CTA_EXPECT_MAX , }, [IPCTNL_MSG_EXP_NEW ] = { .call = ctnetlink_new_expect,
@@ -1568,14 +1568,14 @@ static struct nfnl_callback ctnl_exp_cb[IPCTNL_MSG_EXP_MAX] = { .attr_count = CTA_EXPECT_MAX, }, }; -static struct nfnetlink_subsystem ctnl_subsys = { +static const struct nfnetlink_subsystem ctnl_subsys = { .name ="conntrack" , .subsys_id =NFNL_SUBSYS_CTNETLINK , .cb_count =IPCTNL_MSG_MAX , .cb = ctnl_cb, }; -static struct nfnetlink_subsystem ctnl_exp_subsys = { +static const struct nfnetlink_subsystem ctnl_exp_subsys = { .name ="conntrack_expect" , .subsys_id =NFNL_SUBSYS_CTNETLINK_EXP , .cb_count = IPCTNL_MSG_EXP_MAX,
net/netfilter/nfnetlink.c +9 -9
@@ -41,7 +41,7 @@ MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_NETFILTER);static char __initdata nfversion[] ="0.30" ;static struct sock *nfnl =NULL ; -static struct nfnetlink_subsystem *subsys_table[NFNL_SUBSYS_COUNT ]; +static const struct nfnetlink_subsystem *subsys_table[NFNL_SUBSYS_COUNT ];static DEFINE_MUTEX (nfnl_mutex);static void nfnl_lock (void )
@@ -66,7 +66,7 @@ static void nfnl_unlock(void) nfnl->sk_data_ready (nfnl,0 ); } -int nfnetlink_subsys_register (struct nfnetlink_subsystem *n) +int nfnetlink_subsys_register (const struct nfnetlink_subsystem *n) {nfnl_lock ();if (subsys_table[n->subsys_id]) {
@@ -80,7 +80,7 @@ int nfnetlink_subsys_register(struct nfnetlink_subsystem *n) }EXPORT_SYMBOL_GPL (nfnetlink_subsys_register); -int nfnetlink_subsys_unregister (struct nfnetlink_subsystem *n) +int nfnetlink_subsys_unregister (const struct nfnetlink_subsystem *n) {nfnl_lock (); subsys_table[n->subsys_id] =NULL ;
@@ -90,7 +90,7 @@ int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n) }EXPORT_SYMBOL_GPL (nfnetlink_subsys_unregister); -static inline struct nfnetlink_subsystem *nfnetlink_get_subsys (u_int16_t type) +static inline const struct nfnetlink_subsystem *nfnetlink_get_subsys (u_int16_t type) {u_int8_t subsys_id =NFNL_SUBSYS_ID (type);
@@ -100,8 +100,8 @@ static inline struct nfnetlink_subsystem *nfnetlink_get_subsys(u_int16_t type)return subsys_table[subsys_id]; } -static inline struct nfnl_callback * -nfnetlink_find_client (u_int16_t type,struct nfnetlink_subsystem *ss) +static inline const struct nfnl_callback * +nfnetlink_find_client (u_int16_t type,const struct nfnetlink_subsystem *ss) {u_int8_t cb_id =NFNL_MSG_TYPE (type);
@@ -147,7 +147,7 @@ EXPORT_SYMBOL_GPL(nfattr_parse);* */ static int -nfnetlink_check_attributes (struct nfnetlink_subsystem *subsys, +nfnetlink_check_attributes (const struct nfnetlink_subsystem *subsys,struct nlmsghdr *nlh,struct nfattr *cda[]) {int min_len =NLMSG_SPACE (sizeof (struct nfgenmsg ));
@@ -197,8 +197,8 @@ EXPORT_SYMBOL_GPL(nfnetlink_unicast);/* Process one complete nfnetlink message. */ static int nfnetlink_rcv_msg (struct sk_buff *skb,struct nlmsghdr *nlh) { -struct nfnl_callback *nc; -struct nfnetlink_subsystem *ss; +const struct nfnl_callback *nc; +const struct nfnetlink_subsystem *ss;int type, err;if (security_netlink_recv (skb,CAP_NET_ADMIN ))
net/netfilter/nfnetlink_log.c +2 -2
@@ -883,14 +883,14 @@ out:return ret; } -static struct nfnl_callback nfulnl_cb[NFULNL_MSG_MAX ] = { +static const struct nfnl_callback nfulnl_cb[NFULNL_MSG_MAX ] = { [NFULNL_MSG_PACKET ] = { .call = nfulnl_recv_unsupp, .attr_count =NFULA_MAX , }, [NFULNL_MSG_CONFIG ] = { .call = nfulnl_recv_config, .attr_count =NFULA_CFG_MAX , }, }; -static struct nfnetlink_subsystem nfulnl_subsys = { +static const struct nfnetlink_subsystem nfulnl_subsys = { .name ="log" , .subsys_id =NFNL_SUBSYS_ULOG , .cb_count =NFULNL_MSG_MAX ,
net/netfilter/nfnetlink_queue.c +2 -2
@@ -961,7 +961,7 @@ out_put:return ret; } -static struct nfnl_callback nfqnl_cb[NFQNL_MSG_MAX ] = { +static const struct nfnl_callback nfqnl_cb[NFQNL_MSG_MAX ] = { [NFQNL_MSG_PACKET ] = { .call = nfqnl_recv_unsupp, .attr_count =NFQA_MAX , }, [NFQNL_MSG_VERDICT ] = { .call = nfqnl_recv_verdict,
@@ -970,7 +970,7 @@ static struct nfnl_callback nfqnl_cb[NFQNL_MSG_MAX] = { .attr_count = NFQA_CFG_MAX, }, }; -static struct nfnetlink_subsystem nfqnl_subsys = { +static const struct nfnetlink_subsystem nfqnl_subsys = { .name ="nf_queue" , .subsys_id =NFNL_SUBSYS_QUEUE , .cb_count = NFQNL_MSG_MAX,
PATCH 2/19 : nfnetlink: convert to generic netlink attribute functions
In reply to Patrick McHardy[NETFILTER]: nfnetlink: convert to generic netlink attribute functions
Get rid of the duplicated rtnetlink macros and use the generic netlink attribute functions. The old duplicated stuff is moved to a new header file that exists just for userspace.
---
commit 7264cb1fe6541b376129c512f2a28a198e52a117
tree 5387bd3f4ea2e24fddf826eaea2f44ab5deb356e
parent 03d16f1357128ee213012f18911a3cdabc353c13
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:02 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:02 +0200
include/linux/netfilter/Kbuild | 1 include/linux/netfilter/nfnetlink.h | 78 ----- include/linux/netfilter/nfnetlink_compat.h | 61 ++++ include/net/netfilter/nf_conntrack_l3proto.h | 5 include/net/netfilter/nf_conntrack_l4proto.h | 10 - include/net/netfilter/nf_nat_protocol.h | 4 net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 20 + net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 30 +- net/ipv4/netfilter/nf_nat_core.c | 16 - net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 20 + net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 30 +- net/netfilter/nf_conntrack_core.c | 21 + net/netfilter/nf_conntrack_netlink.c | 393 +++++++++++++----------- net/netfilter/nf_conntrack_proto_tcp.c | 63 ++-- net/netfilter/nfnetlink.c | 39 -- net/netfilter/nfnetlink_log.c | 155 +++++---- net/netfilter/nfnetlink_queue.c | 113 +++---- 17 files changed, 527 insertions(+), 532 deletions(-)
include/linux/netfilter/Kbuild +1 -0
@@ -40,5 +40,6 @@ unifdef-y += nf_conntrack_common.h unifdef-y += nf_conntrack_ftp.h unifdef-y += nf_conntrack_tcp.h unifdef-y += nfnetlink.h +unifdef-y += nfnetlink_compat.h unifdef-y += x_tables.h unifdef-y += xt_physdev.h
include/linux/netfilter/nfnetlink.h +6 -72
119 lines not on this page · raw message
include/linux/netfilter/nfnetlink_compat.h new file +61 -0
61 lines not on this page · raw message
include/net/netfilter/nf_conntrack_l3proto.h +2 -3
@@ -11,11 +11,10 @@#ifndef _NF_CONNTRACK_L3PROTO_H#define _NF_CONNTRACK_L3PROTO_H +#include <linux/netlink.h> #include <linux/seq_file.h> #include <net/netfilter/nf_conntrack.h> -struct nfattr ; -struct nf_conntrack_l3proto {/* L3 Protocol Family number. ex) PF_INET */
@@ -67,7 +66,7 @@ struct nf_conntrack_l3protoint (*tuple_to_nfattr)(struct sk_buff *skb,const struct nf_conntrack_tuple *t); -int (*nfattr_to_tuple)(struct nfattr *tb[], +int (*nfattr_to_tuple)(struct nlattr *tb[],struct nf_conntrack_tuple *t);#ifdef CONFIG_SYSCTL
include/net/netfilter/nf_conntrack_l4proto.h +5 -5
@@ -9,10 +9,10 @@#ifndef _NF_CONNTRACK_L4PROTO_H#define _NF_CONNTRACK_L4PROTO_H +#include <linux/netlink.h> #include <net/netfilter/nf_conntrack.h> struct seq_file ; -struct nfattr ;struct nf_conntrack_l4proto {
@@ -65,15 +65,15 @@ struct nf_conntrack_l4proto int pf, unsigned int hooknum);/* convert protoinfo to nfnetink attributes */ -int (*to_nfattr)(struct sk_buff *skb,struct nfattr *nfa, +int (*to_nfattr)(struct sk_buff *skb,struct nlattr *nla,const struct nf_conn *ct);/* convert nfnetlink attributes to protoinfo */ -int (*from_nfattr)(struct nfattr *tb[],struct nf_conn *ct); +int (*from_nfattr)(struct nlattr *tb[],struct nf_conn *ct);int (*tuple_to_nfattr)(struct sk_buff *skb,const struct nf_conntrack_tuple *t); -int (*nfattr_to_tuple)(struct nfattr *tb[], +int (*nfattr_to_tuple)(struct nlattr *tb[],struct nf_conntrack_tuple *t);#ifdef CONFIG_SYSCTL
@@ -113,7 +113,7 @@ extern void nf_conntrack_l4proto_unregister(struct nf_conntrack_l4proto *proto);/* Generic netlink helpers */ extern int nf_ct_port_tuple_to_nfattr (struct sk_buff *skb,const struct nf_conntrack_tuple *tuple); -extern int nf_ct_port_nfattr_to_tuple (struct nfattr *tb[], +extern int nf_ct_port_nfattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t);/* Log invalid packets */
include/net/netfilter/nf_nat_protocol.h +2 -2
@@ -41,7 +41,7 @@ struct nf_nat_protocolint (*range_to_nfattr)(struct sk_buff *skb,const struct nf_nat_range *range); -int (*nfattr_to_range)(struct nfattr *tb[], +int (*nfattr_to_range)(struct nlattr *tb[],struct nf_nat_range *range); };
@@ -64,7 +64,7 @@ extern struct nf_nat_protocol *find_nat_proto(u_int16_t protonum);extern int nf_nat_port_range_to_nfattr (struct sk_buff *skb,const struct nf_nat_range *range); -extern int nf_nat_port_nfattr_to_range (struct nfattr *tb[], +extern int nf_nat_port_nfattr_to_range (struct nlattr *tb[],struct nf_nat_range *range);#endif /*_NF_NAT_PROTO_H*/
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +10 -10
@@ -363,32 +363,32 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)static int ipv4_tuple_to_nfattr (struct sk_buff *skb,const struct nf_conntrack_tuple *tuple) { -NFA_PUT (skb,CTA_IP_V4_SRC ,sizeof (u_int32_t), +NLA_PUT (skb,CTA_IP_V4_SRC ,sizeof (u_int32_t), &tuple->src.u3.ip); -NFA_PUT (skb,CTA_IP_V4_DST ,sizeof (u_int32_t), +NLA_PUT (skb,CTA_IP_V4_DST ,sizeof (u_int32_t), &tuple->dst.u3.ip);return 0 ; -nfattr_failure: +nla_put_failure:return -1 ; } -static const size_t cta_min_ip[CTA_IP_MAX ] = { - [CTA_IP_V4_SRC -1 ] =sizeof (u_int32_t), - [CTA_IP_V4_DST -1 ] =sizeof (u_int32_t), +static const size_t cta_min_ip[CTA_IP_MAX +1 ] = { + [CTA_IP_V4_SRC ] =sizeof (u_int32_t), + [CTA_IP_V4_DST ] =sizeof (u_int32_t), }; -static int ipv4_nfattr_to_tuple (struct nfattr *tb[], +static int ipv4_nfattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t) { -if (!tb[CTA_IP_V4_SRC -1 ] || !tb[CTA_IP_V4_DST -1 ]) +if (!tb[CTA_IP_V4_SRC ] || !tb[CTA_IP_V4_DST ])return -EINVAL ;if (nfattr_bad_size (tb,CTA_IP_MAX , cta_min_ip))return -EINVAL ; - t->src.u3.ip = *(__be32 *)NFA_DATA (tb[CTA_IP_V4_SRC -1 ]); - t->dst.u3.ip = *(__be32 *)NFA_DATA (tb[CTA_IP_V4_DST -1 ]); + t->src.u3.ip = *(__be32 *)nla_data (tb[CTA_IP_V4_SRC ]); + t->dst.u3.ip = *(__be32 *)nla_data (tb[CTA_IP_V4_DST ]);return 0 ; }
net/ipv4/netfilter/nf_conntrack_proto_icmp.c +15 -15
@@ -235,42 +235,42 @@ icmp_error(struct sk_buff *skb, unsigned int dataoff,static int icmp_tuple_to_nfattr (struct sk_buff *skb,const struct nf_conntrack_tuple *t) { -NFA_PUT (skb,CTA_PROTO_ICMP_ID ,sizeof (u_int16_t), +NLA_PUT (skb,CTA_PROTO_ICMP_ID ,sizeof (u_int16_t), &t->src.u.icmp.id); -NFA_PUT (skb,CTA_PROTO_ICMP_TYPE ,sizeof (u_int8_t), +NLA_PUT (skb,CTA_PROTO_ICMP_TYPE ,sizeof (u_int8_t), &t->dst.u.icmp.type); -NFA_PUT (skb,CTA_PROTO_ICMP_CODE ,sizeof (u_int8_t), +NLA_PUT (skb,CTA_PROTO_ICMP_CODE ,sizeof (u_int8_t), &t->dst.u.icmp.code);return 0 ; -nfattr_failure: +nla_put_failure:return -1 ; } -static const size_t cta_min_proto[CTA_PROTO_MAX ] = { - [CTA_PROTO_ICMP_TYPE -1 ] =sizeof (u_int8_t), - [CTA_PROTO_ICMP_CODE -1 ] =sizeof (u_int8_t), - [CTA_PROTO_ICMP_ID -1 ] =sizeof (u_int16_t) +static const size_t cta_min_proto[CTA_PROTO_MAX +1 ] = { + [CTA_PROTO_ICMP_TYPE ] =sizeof (u_int8_t), + [CTA_PROTO_ICMP_CODE ] =sizeof (u_int8_t), + [CTA_PROTO_ICMP_ID ] =sizeof (u_int16_t) }; -static int icmp_nfattr_to_tuple (struct nfattr *tb[], +static int icmp_nfattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *tuple) { -if (!tb[CTA_PROTO_ICMP_TYPE -1 ] - || !tb[CTA_PROTO_ICMP_CODE -1 ] - || !tb[CTA_PROTO_ICMP_ID -1 ]) +if (!tb[CTA_PROTO_ICMP_TYPE ] + || !tb[CTA_PROTO_ICMP_CODE ] + || !tb[CTA_PROTO_ICMP_ID ])return -EINVAL ;if (nfattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto))return -EINVAL ; tuple->dst.u.icmp.type = - *(u_int8_t *)NFA_DATA (tb[CTA_PROTO_ICMP_TYPE -1 ]); + *(u_int8_t *)nla_data (tb[CTA_PROTO_ICMP_TYPE ]); tuple->dst.u.icmp.code = - *(u_int8_t *)NFA_DATA (tb[CTA_PROTO_ICMP_CODE -1 ]); + *(u_int8_t *)nla_data (tb[CTA_PROTO_ICMP_CODE ]); tuple->src.u.icmp.id = - *(__be16 *)NFA_DATA (tb[CTA_PROTO_ICMP_ID -1 ]); + *(__be16 *)nla_data (tb[CTA_PROTO_ICMP_ID ]);if (tuple->dst.u.icmp.type >=sizeof (invmap) || !invmap[tuple->dst.u.icmp.type])
net/ipv4/netfilter/nf_nat_core.c +8 -8
@@ -547,38 +547,38 @@ int nf_nat_port_range_to_nfattr(struct sk_buff *skb, const struct nf_nat_range *range) { -NFA_PUT (skb, CTA_PROTONAT_PORT_MIN, sizeof(__be16 ), +NLA_PUT (skb, CTA_PROTONAT_PORT_MIN, sizeof(__be16 ), &range->min.tcp.port); -NFA_PUT (skb,CTA_PROTONAT_PORT_MAX ,sizeof (__be16), +NLA_PUT (skb,CTA_PROTONAT_PORT_MAX ,sizeof (__be16), &range->max.tcp.port);return 0 ; -nfattr_failure: +nla_put_failure:return -1 ; }EXPORT_SYMBOL_GPL (nf_nat_port_nfattr_to_range);int -nf_nat_port_nfattr_to_range (struct nfattr *tb[],struct nf_nat_range *range) +nf_nat_port_nfattr_to_range (struct nlattr *tb[],struct nf_nat_range *range) {int ret =0 ;/* we have to return whether we actually parsed something or not */ -if (tb[CTA_PROTONAT_PORT_MIN -1 ]) { +if (tb[CTA_PROTONAT_PORT_MIN ]) { ret =1 ; range->min.tcp.port = - *(__be16 *)NFA_DATA (tb[CTA_PROTONAT_PORT_MIN -1 ]); + *(__be16 *)nla_data (tb[CTA_PROTONAT_PORT_MIN ]); } -if (!tb[CTA_PROTONAT_PORT_MAX -1 ]) { +if (!tb[CTA_PROTONAT_PORT_MAX ]) {if (ret) range->max.tcp.port = range->min.tcp.port; }else { ret =1 ; range->max.tcp.port = - *(__be16 *)NFA_DATA (tb[CTA_PROTONAT_PORT_MAX -1 ]); + *(__be16 *)nla_data (tb[CTA_PROTONAT_PORT_MAX ]); }return ret;
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +10 -10
@@ -340,33 +340,33 @@ static ctl_table nf_ct_ipv6_sysctl_table[] = {static int ipv6_tuple_to_nfattr (struct sk_buff *skb,const struct nf_conntrack_tuple *tuple) { -NFA_PUT (skb,CTA_IP_V6_SRC ,sizeof (u_int32_t) *4 , +NLA_PUT (skb,CTA_IP_V6_SRC ,sizeof (u_int32_t) *4 , &tuple->src.u3.ip6); -NFA_PUT (skb,CTA_IP_V6_DST ,sizeof (u_int32_t) *4 , +NLA_PUT (skb,CTA_IP_V6_DST ,sizeof (u_int32_t) *4 , &tuple->dst.u3.ip6);return 0 ; -nfattr_failure: +nla_put_failure:return -1 ; } -static const size_t cta_min_ip[CTA_IP_MAX ] = { - [CTA_IP_V6_SRC -1 ] =sizeof (u_int32_t)*4 , - [CTA_IP_V6_DST -1 ] =sizeof (u_int32_t)*4 , +static const size_t cta_min_ip[CTA_IP_MAX +1 ] = { + [CTA_IP_V6_SRC ] =sizeof (u_int32_t)*4 , + [CTA_IP_V6_DST ] =sizeof (u_int32_t)*4 , }; -static int ipv6_nfattr_to_tuple (struct nfattr *tb[], +static int ipv6_nfattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t) { -if (!tb[CTA_IP_V6_SRC -1 ] || !tb[CTA_IP_V6_DST -1 ]) +if (!tb[CTA_IP_V6_SRC ] || !tb[CTA_IP_V6_DST ])return -EINVAL ;if (nfattr_bad_size (tb,CTA_IP_MAX , cta_min_ip))return -EINVAL ; -memcpy (&t->src.u3.ip6,NFA_DATA (tb[CTA_IP_V6_SRC -1 ]), +memcpy (&t->src.u3.ip6,nla_data (tb[CTA_IP_V6_SRC ]),sizeof (u_int32_t) *4 ); -memcpy (&t->dst.u3.ip6,NFA_DATA (tb[CTA_IP_V6_DST -1 ]), +memcpy (&t->dst.u3.ip6,nla_data (tb[CTA_IP_V6_DST ]),sizeof (u_int32_t) *4 );return 0 ;
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +15 -15
@@ -213,42 +213,42 @@ icmpv6_error(struct sk_buff *skb, unsigned int dataoff,static int icmpv6_tuple_to_nfattr (struct sk_buff *skb,const struct nf_conntrack_tuple *t) { -NFA_PUT (skb,CTA_PROTO_ICMPV6_ID ,sizeof (u_int16_t), +NLA_PUT (skb,CTA_PROTO_ICMPV6_ID ,sizeof (u_int16_t), &t->src.u.icmp.id); -NFA_PUT (skb,CTA_PROTO_ICMPV6_TYPE ,sizeof (u_int8_t), +NLA_PUT (skb,CTA_PROTO_ICMPV6_TYPE ,sizeof (u_int8_t), &t->dst.u.icmp.type); -NFA_PUT (skb,CTA_PROTO_ICMPV6_CODE ,sizeof (u_int8_t), +NLA_PUT (skb,CTA_PROTO_ICMPV6_CODE ,sizeof (u_int8_t), &t->dst.u.icmp.code);return 0 ; -nfattr_failure: +nla_put_failure:return -1 ; } -static const size_t cta_min_proto[CTA_PROTO_MAX ] = { - [CTA_PROTO_ICMPV6_TYPE -1 ] =sizeof (u_int8_t), - [CTA_PROTO_ICMPV6_CODE -1 ] =sizeof (u_int8_t), - [CTA_PROTO_ICMPV6_ID -1 ] =sizeof (u_int16_t) +static const size_t cta_min_proto[CTA_PROTO_MAX +1 ] = { + [CTA_PROTO_ICMPV6_TYPE ] =sizeof (u_int8_t), + [CTA_PROTO_ICMPV6_CODE ] =sizeof (u_int8_t), + [CTA_PROTO_ICMPV6_ID ] =sizeof (u_int16_t) }; -static int icmpv6_nfattr_to_tuple (struct nfattr *tb[], +static int icmpv6_nfattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *tuple) { -if (!tb[CTA_PROTO_ICMPV6_TYPE -1 ] - || !tb[CTA_PROTO_ICMPV6_CODE -1 ] - || !tb[CTA_PROTO_ICMPV6_ID -1 ]) +if (!tb[CTA_PROTO_ICMPV6_TYPE ] + || !tb[CTA_PROTO_ICMPV6_CODE ] + || !tb[CTA_PROTO_ICMPV6_ID ])return -EINVAL ;if (nfattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto))return -EINVAL ; tuple->dst.u.icmp.type = - *(u_int8_t *)NFA_DATA (tb[CTA_PROTO_ICMPV6_TYPE -1 ]); + *(u_int8_t *)nla_data (tb[CTA_PROTO_ICMPV6_TYPE ]); tuple->dst.u.icmp.code = - *(u_int8_t *)NFA_DATA (tb[CTA_PROTO_ICMPV6_CODE -1 ]); + *(u_int8_t *)nla_data (tb[CTA_PROTO_ICMPV6_CODE ]); tuple->src.u.icmp.id = - *(__be16 *)NFA_DATA (tb[CTA_PROTO_ICMPV6_ID -1 ]); + *(__be16 *)nla_data (tb[CTA_PROTO_ICMPV6_ID ]);if (tuple->dst.u.icmp.type <128 || tuple->dst.u.icmp.type - 128 >= sizeof(invmap)
net/netfilter/nf_conntrack_core.c +10 -11
@@ -827,40 +827,39 @@ EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct);#include <linux/netfilter/nfnetlink_conntrack.h> #include <linux/mutex.h> -/* Generic function for tcp/udp/sctp/dccp and alike. This needs to be * in ip_conntrack_core, since we don't want the protocols to autoload * or depend on ctnetlink */ int nf_ct_port_tuple_to_nfattr (struct sk_buff *skb,const struct nf_conntrack_tuple *tuple) { -NFA_PUT (skb,CTA_PROTO_SRC_PORT ,sizeof (u_int16_t), +NLA_PUT (skb,CTA_PROTO_SRC_PORT ,sizeof (u_int16_t), &tuple->src.u.tcp.port); -NFA_PUT (skb,CTA_PROTO_DST_PORT ,sizeof (u_int16_t), +NLA_PUT (skb,CTA_PROTO_DST_PORT ,sizeof (u_int16_t), &tuple->dst.u.tcp.port);return 0 ; -nfattr_failure: +nla_put_failure:return -1 ; }EXPORT_SYMBOL_GPL (nf_ct_port_tuple_to_nfattr); -static const size_t cta_min_proto[CTA_PROTO_MAX ] = { - [CTA_PROTO_SRC_PORT -1 ] =sizeof (u_int16_t), - [CTA_PROTO_DST_PORT -1 ] =sizeof (u_int16_t) +static const size_t cta_min_proto[CTA_PROTO_MAX +1 ] = { + [CTA_PROTO_SRC_PORT ] =sizeof (u_int16_t), + [CTA_PROTO_DST_PORT ] =sizeof (u_int16_t) }; -int nf_ct_port_nfattr_to_tuple (struct nfattr *tb[], +int nf_ct_port_nfattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t) { -if (!tb[CTA_PROTO_SRC_PORT -1 ] || !tb[CTA_PROTO_DST_PORT -1 ]) +if (!tb[CTA_PROTO_SRC_PORT ] || !tb[CTA_PROTO_DST_PORT ])return -EINVAL ;if (nfattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto))return -EINVAL ; - t->src.u.tcp.port = *(__be16 *)NFA_DATA (tb[CTA_PROTO_SRC_PORT -1 ]); - t->dst.u.tcp.port = *(__be16 *)NFA_DATA (tb[CTA_PROTO_DST_PORT -1 ]); + t->src.u.tcp.port = *(__be16 *)nla_data (tb[CTA_PROTO_SRC_PORT ]); + t->dst.u.tcp.port = *(__be16 *)nla_data (tb[CTA_PROTO_DST_PORT ]);return 0 ; }
net/netfilter/nf_conntrack_netlink.c +210 -183
1,009 lines not on this page · raw message
net/netfilter/nf_conntrack_proto_tcp.c +33 -30
126 lines not on this page · raw message
net/netfilter/nfnetlink.c +6 -33
@@ -111,44 +111,17 @@ nfnetlink_find_client(u_int16_t type, const struct nfnetlink_subsystem *ss)return &ss->cb[cb_id]; } -void __nfa_fill (struct sk_buff *skb,int attrtype,int attrlen, -const void *data) -{ -struct nfattr *nfa; -int size =NFA_LENGTH (attrlen); - - nfa = (struct nfattr *)skb_put (skb,NFA_ALIGN (size)); - nfa->nfa_type = attrtype; - nfa->nfa_len = size; -memcpy (NFA_DATA (nfa), data, attrlen); -memset (NFA_DATA (nfa) + attrlen,0 ,NFA_ALIGN (size) - size); -} -EXPORT_SYMBOL_GPL (__nfa_fill); - -void nfattr_parse (struct nfattr *tb[],int maxattr,struct nfattr *nfa,int len) -{ -memset (tb,0 ,sizeof (struct nfattr *) * maxattr); - -while (NFA_OK (nfa, len)) { -unsigned flavor =NFA_TYPE (nfa); -if (flavor && flavor <= maxattr) - tb[flavor-1 ] = nfa; - nfa =NFA_NEXT (nfa, len); - } -} -EXPORT_SYMBOL_GPL (nfattr_parse); -/** * nfnetlink_check_attributes - check and parse nfnetlink attributes * * subsys: nfnl subsystem for which this message is to be parsed * nlmsghdr: netlink message to be checked/parsed -* cda: array of pointers, needs to be at least subsys->attr_count big +* cda: array of pointers, needs to be at least subsys->attr_count+1 big * */ static int nfnetlink_check_attributes (const struct nfnetlink_subsystem *subsys, -struct nlmsghdr *nlh,struct nfattr *cda[]) +struct nlmsghdr *nlh,struct nlattr *cda[]) {int min_len =NLMSG_SPACE (sizeof (struct nfgenmsg ));u_int8_t cb_id =NFNL_MSG_TYPE (nlh->nlmsg_type);
@@ -156,9 +129,9 @@ nfnetlink_check_attributes(const struct nfnetlink_subsystem *subsys,/* check attribute lengths. */ if (likely (nlh->nlmsg_len > min_len)) { -struct nfattr *attr =NFM_NFA (NLMSG_DATA (nlh)); +struct nlattr *attr = (void *)nlh +NLMSG_ALIGN (min_len);int attrlen = nlh->nlmsg_len -NLMSG_ALIGN (min_len); -nfattr_parse (cda, attr_count, attr, attrlen); +nla_parse (cda, attr_count, attr, attrlen,NULL ); }/* implicit: if nlmsg_len == min_len, we return 0, and an empty
@@ -230,9 +203,9 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) {u_int16_t attr_count = ss->cb[NFNL_MSG_TYPE (nlh->nlmsg_type)].attr_count; -struct nfattr *cda[attr_count]; +struct nlattr *cda[attr_count+1 ]; -memset (cda,0 ,sizeof (struct nfattr *) * attr_count); +memset (cda,0 ,sizeof (struct nlattr *) * attr_count); err =nfnetlink_check_attributes (ss, nlh, cda);if (err <0 )
net/netfilter/nfnetlink_log.c +77 -78
341 lines not on this page · raw message
net/netfilter/nfnetlink_queue.c +56 -57
285 lines not on this page · raw message
PATCH 3/19 : nfnetlink: rename functions containing 'nfattr'
In reply to Patrick McHardy[NETFILTER]: nfnetlink: rename functions containing 'nfattr'
There is no struct nfattr anymore, rename functions to 'nlattr'.
---
commit 46958d51af5d65a36b04e8c8aabba6d86b19b4c7
tree f4114b05757acaaeb3a1a63d30a3910e60886717
parent 7264cb1fe6541b376129c512f2a28a198e52a117
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:13 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:13 +0200
include/linux/netfilter/nfnetlink.h | 2 - include/net/netfilter/nf_conntrack_helper.h | 2 - include/net/netfilter/nf_conntrack_l3proto.h | 4 +- include/net/netfilter/nf_conntrack_l4proto.h | 12 +++--- include/net/netfilter/nf_nat_protocol.h | 8 ++-- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 10 ++--- net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 10 ++--- net/ipv4/netfilter/nf_nat_core.c | 8 ++-- net/ipv4/netfilter/nf_nat_proto_gre.c | 4 +- net/ipv4/netfilter/nf_nat_proto_icmp.c | 4 +- net/ipv4/netfilter/nf_nat_proto_tcp.c | 4 +- net/ipv4/netfilter/nf_nat_proto_udp.c | 4 +- net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 10 ++--- net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 10 ++--- net/netfilter/nf_conntrack_core.c | 10 ++--- net/netfilter/nf_conntrack_netlink.c | 52 ++++++++++++------------ net/netfilter/nf_conntrack_proto_gre.c | 4 +- net/netfilter/nf_conntrack_proto_tcp.c | 22 +++++----- net/netfilter/nf_conntrack_proto_udp.c | 8 ++-- net/netfilter/nf_conntrack_proto_udplite.c | 8 ++-- net/netfilter/nfnetlink_log.c | 2 - net/netfilter/nfnetlink_queue.c | 4 +- 22 files changed, 101 insertions(+), 101 deletions(-)
include/linux/netfilter/nfnetlink.h +1 -1
@@ -72,7 +72,7 @@ struct nfnetlink_subsystemextern int nfnetlink_subsys_register (const struct nfnetlink_subsystem *n);extern int nfnetlink_subsys_unregister (const struct nfnetlink_subsystem *n); -#define nfattr_bad_size (tb, max, cta_min) \ +#define nlattr_bad_size (tb, max, cta_min) \ ({ int __i, __res = 0; \ for (__i=1; __i <= max; __i++) { \ if (!cta_min[__i]) \
include/net/netfilter/nf_conntrack_helper.h +1 -1
@@ -36,7 +36,7 @@ struct nf_conntrack_helpervoid (*destroy)(struct nf_conn *ct); -int (*to_nfattr)(struct sk_buff *skb,const struct nf_conn *ct); +int (*to_nlattr)(struct sk_buff *skb,const struct nf_conn *ct); }; extern struct nf_conntrack_helper *
include/net/netfilter/nf_conntrack_l3proto.h +2 -2
@@ -63,10 +63,10 @@ struct nf_conntrack_l3protoint (*get_l4proto)(const struct sk_buff *skb,unsigned int nhoff,unsigned int *dataoff,u_int8_t *protonum); -int (*tuple_to_nfattr)(struct sk_buff *skb, +int (*tuple_to_nlattr)(struct sk_buff *skb,const struct nf_conntrack_tuple *t); -int (*nfattr_to_tuple)(struct nlattr *tb[], +int (*nlattr_to_tuple)(struct nlattr *tb[],struct nf_conntrack_tuple *t);#ifdef CONFIG_SYSCTL
include/net/netfilter/nf_conntrack_l4proto.h +6 -6
@@ -65,15 +65,15 @@ struct nf_conntrack_l4proto int pf, unsigned int hooknum);/* convert protoinfo to nfnetink attributes */ -int (*to_nfattr)(struct sk_buff *skb,struct nlattr *nla, +int (*to_nlattr)(struct sk_buff *skb,struct nlattr *nla,const struct nf_conn *ct);/* convert nfnetlink attributes to protoinfo */ -int (*from_nfattr)(struct nlattr *tb[],struct nf_conn *ct); +int (*from_nlattr)(struct nlattr *tb[],struct nf_conn *ct); -int (*tuple_to_nfattr)(struct sk_buff *skb, +int (*tuple_to_nlattr)(struct sk_buff *skb,const struct nf_conntrack_tuple *t); -int (*nfattr_to_tuple)(struct nlattr *tb[], +int (*nlattr_to_tuple)(struct nlattr *tb[],struct nf_conntrack_tuple *t);#ifdef CONFIG_SYSCTL
@@ -111,9 +111,9 @@ extern int nf_conntrack_l4proto_register(struct nf_conntrack_l4proto *proto);extern void nf_conntrack_l4proto_unregister (struct nf_conntrack_l4proto *proto);/* Generic netlink helpers */ -extern int nf_ct_port_tuple_to_nfattr (struct sk_buff *skb, +extern int nf_ct_port_tuple_to_nlattr (struct sk_buff *skb,const struct nf_conntrack_tuple *tuple); -extern int nf_ct_port_nfattr_to_tuple (struct nlattr *tb[], +extern int nf_ct_port_nlattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t);/* Log invalid packets */
include/net/netfilter/nf_nat_protocol.h +4 -4
@@ -38,10 +38,10 @@ struct nf_nat_protocolenum nf_nat_manip_type maniptype, const struct nf_conn *ct); -int (*range_to_nfattr)(struct sk_buff *skb, +int (*range_to_nlattr)(struct sk_buff *skb,const struct nf_nat_range *range); -int (*nfattr_to_range)(struct nlattr *tb[], +int (*nlattr_to_range)(struct nlattr *tb[],struct nf_nat_range *range); };
@@ -62,9 +62,9 @@ extern int init_protocols(void) __init;extern void cleanup_protocols (void );extern struct nf_nat_protocol *find_nat_proto (u_int16_t protonum); -extern int nf_nat_port_range_to_nfattr (struct sk_buff *skb, +extern int nf_nat_port_range_to_nlattr (struct sk_buff *skb,const struct nf_nat_range *range); -extern int nf_nat_port_nfattr_to_range (struct nlattr *tb[], +extern int nf_nat_port_nlattr_to_range (struct nlattr *tb[],struct nf_nat_range *range);#endif /*_NF_NAT_PROTO_H*/
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +5 -5
@@ -360,7 +360,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)#include <linux/netfilter/nfnetlink.h> #include <linux/netfilter/nfnetlink_conntrack.h> -static int ipv4_tuple_to_nfattr (struct sk_buff *skb, +static int ipv4_tuple_to_nlattr (struct sk_buff *skb,const struct nf_conntrack_tuple *tuple) { NLA_PUT(skb, CTA_IP_V4_SRC, sizeof(u_int32_t),
@@ -378,13 +378,13 @@ static const size_t cta_min_ip[CTA_IP_MAX+1] = { [CTA_IP_V4_DST] = sizeof(u_int32_t), }; -static int ipv4_nfattr_to_tuple (struct nlattr *tb[], +static int ipv4_nlattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t) {if (!tb[CTA_IP_V4_SRC ] || !tb[CTA_IP_V4_DST ])return -EINVAL ; -if (nfattr_bad_size (tb,CTA_IP_MAX , cta_min_ip)) +if (nlattr_bad_size (tb,CTA_IP_MAX , cta_min_ip))return -EINVAL ; t->src.u3.ip = *(__be32 *)nla_data (tb[CTA_IP_V4_SRC ]);
@@ -411,8 +411,8 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = { .print_conntrack = ipv4_print_conntrack, .get_l4proto = ipv4_get_l4proto,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .tuple_to_nfattr = ipv4_tuple_to_nfattr, - .nfattr_to_tuple = ipv4_nfattr_to_tuple, + .tuple_to_nlattr = ipv4_tuple_to_nlattr, + .nlattr_to_tuple = ipv4_nlattr_to_tuple,#endif #if defined(CONFIG_SYSCTL ) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT ) .ctl_table_path = nf_net_ipv4_netfilter_sysctl_path,
net/ipv4/netfilter/nf_conntrack_proto_icmp.c +5 -5
@@ -232,7 +232,7 @@ icmp_error(struct sk_buff *skb, unsigned int dataoff,#include <linux/netfilter/nfnetlink.h> #include <linux/netfilter/nfnetlink_conntrack.h> -static int icmp_tuple_to_nfattr (struct sk_buff *skb, +static int icmp_tuple_to_nlattr (struct sk_buff *skb,const struct nf_conntrack_tuple *t) { NLA_PUT(skb, CTA_PROTO_ICMP_ID, sizeof(u_int16_t),
@@ -254,7 +254,7 @@ static const size_t cta_min_proto[CTA_PROTO_MAX+1] = { [CTA_PROTO_ICMP_ID ] =sizeof (u_int16_t) }; -static int icmp_nfattr_to_tuple (struct nlattr *tb[], +static int icmp_nlattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *tuple) { if (!tb[CTA_PROTO_ICMP_TYPE]
@@ -262,7 +262,7 @@ static int icmp_nfattr_to_tuple(struct nlattr *tb[], || !tb[CTA_PROTO_ICMP_ID])return -EINVAL ; -if (nfattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto)) +if (nlattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto))return -EINVAL ; tuple->dst.u.icmp.type =
@@ -327,8 +327,8 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp __read_mostly = .destroy = NULL, .me = NULL,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .tuple_to_nfattr = icmp_tuple_to_nfattr, - .nfattr_to_tuple = icmp_nfattr_to_tuple, + .tuple_to_nlattr = icmp_tuple_to_nlattr, + .nlattr_to_tuple = icmp_nlattr_to_tuple,#endif #ifdef CONFIG_SYSCTL .ctl_table_header = &icmp_sysctl_header,
net/ipv4/netfilter/nf_nat_core.c +4 -4
@@ -544,7 +544,7 @@ EXPORT_SYMBOL(nf_nat_protocol_unregister);#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE )int -nf_nat_port_range_to_nfattr (struct sk_buff *skb, +nf_nat_port_range_to_nlattr (struct sk_buff *skb,const struct nf_nat_range *range) { NLA_PUT(skb, CTA_PROTONAT_PORT_MIN, sizeof(__be16),
@@ -557,10 +557,10 @@ nf_nat_port_range_to_nfattr(struct sk_buff *skb, nla_put_failure:return -1 ; } -EXPORT_SYMBOL_GPL (nf_nat_port_nfattr_to_range); +EXPORT_SYMBOL_GPL (nf_nat_port_nlattr_to_range);int -nf_nat_port_nfattr_to_range (struct nlattr *tb[],struct nf_nat_range *range) +nf_nat_port_nlattr_to_range (struct nlattr *tb[],struct nf_nat_range *range) {int ret =0 ;
@@ -583,7 +583,7 @@ nf_nat_port_nfattr_to_range(struct nlattr *tb[], struct nf_nat_range *range) return ret; } -EXPORT_SYMBOL_GPL (nf_nat_port_range_to_nfattr); +EXPORT_SYMBOL_GPL (nf_nat_port_range_to_nlattr);#endif /* Noone using conntrack by the time this called. */
net/ipv4/netfilter/nf_nat_proto_gre.c +2 -2
@@ -142,8 +142,8 @@ static struct nf_nat_protocol gre __read_mostly = { .in_range = gre_in_range, .unique_tuple = gre_unique_tuple,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .range_to_nfattr = nf_nat_port_range_to_nfattr, - .nfattr_to_range = nf_nat_port_nfattr_to_range, + .range_to_nlattr = nf_nat_port_range_to_nlattr, + .nlattr_to_range = nf_nat_port_nlattr_to_range,#endif };
net/ipv4/netfilter/nf_nat_proto_icmp.c +2 -2
@@ -79,7 +79,7 @@ struct nf_nat_protocol nf_nat_protocol_icmp = { .in_range = icmp_in_range, .unique_tuple = icmp_unique_tuple,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .range_to_nfattr = nf_nat_port_range_to_nfattr, - .nfattr_to_range = nf_nat_port_nfattr_to_range, + .range_to_nlattr = nf_nat_port_range_to_nlattr, + .nlattr_to_range = nf_nat_port_nlattr_to_range,#endif };
net/ipv4/netfilter/nf_nat_proto_tcp.c +2 -2
@@ -145,7 +145,7 @@ struct nf_nat_protocol nf_nat_protocol_tcp = { .in_range = tcp_in_range, .unique_tuple = tcp_unique_tuple,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .range_to_nfattr = nf_nat_port_range_to_nfattr, - .nfattr_to_range = nf_nat_port_nfattr_to_range, + .range_to_nlattr = nf_nat_port_range_to_nlattr, + .nlattr_to_range = nf_nat_port_nlattr_to_range,#endif };
net/ipv4/netfilter/nf_nat_proto_udp.c +2 -2
@@ -135,7 +135,7 @@ struct nf_nat_protocol nf_nat_protocol_udp = { .in_range = udp_in_range, .unique_tuple = udp_unique_tuple,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .range_to_nfattr = nf_nat_port_range_to_nfattr, - .nfattr_to_range = nf_nat_port_nfattr_to_range, + .range_to_nlattr = nf_nat_port_range_to_nlattr, + .nlattr_to_range = nf_nat_port_nlattr_to_range,#endif };
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +5 -5
@@ -337,7 +337,7 @@ static ctl_table nf_ct_ipv6_sysctl_table[] = {#include <linux/netfilter/nfnetlink.h> #include <linux/netfilter/nfnetlink_conntrack.h> -static int ipv6_tuple_to_nfattr (struct sk_buff *skb, +static int ipv6_tuple_to_nlattr (struct sk_buff *skb,const struct nf_conntrack_tuple *tuple) { NLA_PUT(skb, CTA_IP_V6_SRC, sizeof(u_int32_t) * 4,
@@ -355,13 +355,13 @@ static const size_t cta_min_ip[CTA_IP_MAX+1] = { [CTA_IP_V6_DST] = sizeof(u_int32_t)*4, }; -static int ipv6_nfattr_to_tuple (struct nlattr *tb[], +static int ipv6_nlattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t) {if (!tb[CTA_IP_V6_SRC ] || !tb[CTA_IP_V6_DST ])return -EINVAL ; -if (nfattr_bad_size (tb,CTA_IP_MAX , cta_min_ip)) +if (nlattr_bad_size (tb,CTA_IP_MAX , cta_min_ip))return -EINVAL ; memcpy(&t->src.u3.ip6, nla_data(tb[CTA_IP_V6_SRC]),
@@ -382,8 +382,8 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6 __read_mostly = { .print_conntrack = ipv6_print_conntrack, .get_l4proto = ipv6_get_l4proto,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .tuple_to_nfattr = ipv6_tuple_to_nfattr, - .nfattr_to_tuple = ipv6_nfattr_to_tuple, + .tuple_to_nlattr = ipv6_tuple_to_nlattr, + .nlattr_to_tuple = ipv6_nlattr_to_tuple,#endif #ifdef CONFIG_SYSCTL .ctl_table_path = nf_net_netfilter_sysctl_path,
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +5 -5
@@ -210,7 +210,7 @@ icmpv6_error(struct sk_buff *skb, unsigned int dataoff,#include <linux/netfilter/nfnetlink.h> #include <linux/netfilter/nfnetlink_conntrack.h> -static int icmpv6_tuple_to_nfattr (struct sk_buff *skb, +static int icmpv6_tuple_to_nlattr (struct sk_buff *skb,const struct nf_conntrack_tuple *t) { NLA_PUT(skb, CTA_PROTO_ICMPV6_ID, sizeof(u_int16_t),
@@ -232,7 +232,7 @@ static const size_t cta_min_proto[CTA_PROTO_MAX+1] = { [CTA_PROTO_ICMPV6_ID ] =sizeof (u_int16_t) }; -static int icmpv6_nfattr_to_tuple (struct nlattr *tb[], +static int icmpv6_nlattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *tuple) { if (!tb[CTA_PROTO_ICMPV6_TYPE]
@@ -240,7 +240,7 @@ static int icmpv6_nfattr_to_tuple(struct nlattr *tb[], || !tb[CTA_PROTO_ICMPV6_ID])return -EINVAL ; -if (nfattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto)) +if (nlattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto))return -EINVAL ; tuple->dst.u.icmp.type =
@@ -289,8 +289,8 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly = .new = icmpv6_new, .error = icmpv6_error,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .tuple_to_nfattr = icmpv6_tuple_to_nfattr, - .nfattr_to_tuple = icmpv6_nfattr_to_tuple, + .tuple_to_nlattr = icmpv6_tuple_to_nlattr, + .nlattr_to_tuple = icmpv6_nlattr_to_tuple,#endif #ifdef CONFIG_SYSCTL .ctl_table_header = &icmpv6_sysctl_header,
net/netfilter/nf_conntrack_core.c +5 -5
@@ -830,7 +830,7 @@ EXPORT_SYMBOL_GPL(__nf_ct_refresh_acct);/* Generic function for tcp/udp/sctp/dccp and alike. This needs to be * in ip_conntrack_core, since we don't want the protocols to autoload * or depend on ctnetlink */ -int nf_ct_port_tuple_to_nfattr (struct sk_buff *skb, +int nf_ct_port_tuple_to_nlattr (struct sk_buff *skb,const struct nf_conntrack_tuple *tuple) { NLA_PUT(skb, CTA_PROTO_SRC_PORT, sizeof(u_int16_t),
@@ -842,20 +842,20 @@ int nf_ct_port_tuple_to_nfattr(struct sk_buff *skb, nla_put_failure:return -1 ; } -EXPORT_SYMBOL_GPL (nf_ct_port_tuple_to_nfattr); +EXPORT_SYMBOL_GPL (nf_ct_port_tuple_to_nlattr);static const size_t cta_min_proto[CTA_PROTO_MAX +1 ] = { [CTA_PROTO_SRC_PORT ] =sizeof (u_int16_t), [CTA_PROTO_DST_PORT ] =sizeof (u_int16_t) }; -int nf_ct_port_nfattr_to_tuple (struct nlattr *tb[], +int nf_ct_port_nlattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t) {if (!tb[CTA_PROTO_SRC_PORT ] || !tb[CTA_PROTO_DST_PORT ])return -EINVAL ; -if (nfattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto)) +if (nlattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto))return -EINVAL ; t->src.u.tcp.port = *(__be16 *)nla_data (tb[CTA_PROTO_SRC_PORT ]);
@@ -863,7 +863,7 @@ int nf_ct_port_nfattr_to_tuple(struct nlattr *tb[], return 0; } -EXPORT_SYMBOL_GPL (nf_ct_port_nfattr_to_tuple); +EXPORT_SYMBOL_GPL (nf_ct_port_nlattr_to_tuple);#endif /* Used by ipt_REJECT and ip6t_REJECT. */
net/netfilter/nf_conntrack_netlink.c +26 -26
162 lines not on this page · raw message
net/netfilter/nf_conntrack_proto_gre.c +2 -2
@@ -274,8 +274,8 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_gre4 __read_mostly = { .destroy = gre_destroy, .me = THIS_MODULE,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, - .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, + .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, + .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,#endif };
net/netfilter/nf_conntrack_proto_tcp.c +11 -11
@@ -1067,7 +1067,7 @@ static int tcp_new(struct nf_conn *conntrack,#include <linux/netfilter/nfnetlink.h> #include <linux/netfilter/nfnetlink_conntrack.h> -static int tcp_to_nfattr (struct sk_buff *skb,struct nlattr *nla, +static int tcp_to_nlattr (struct sk_buff *skb,struct nlattr *nla,const struct nf_conn *ct) {struct nlattr *nest_parms;
@@ -1113,7 +1113,7 @@ static const size_t cta_min_tcp[CTA_PROTOINFO_TCP_MAX+1] = { [CTA_PROTOINFO_TCP_FLAGS_REPLY] = sizeof(struct nf_ct_tcp_flags) }; -static int nfattr_to_tcp (struct nlattr *cda[],struct nf_conn *ct) +static int nlattr_to_tcp (struct nlattr *cda[],struct nf_conn *ct) {struct nlattr *attr = cda[CTA_PROTOINFO_TCP ];struct nlattr *tb[CTA_PROTOINFO_TCP_MAX +1 ];
@@ -1125,7 +1125,7 @@ static int nfattr_to_tcp(struct nlattr *cda[], struct nf_conn *ct)nla_parse_nested (tb,CTA_PROTOINFO_TCP_MAX , attr,NULL ); -if (nfattr_bad_size (tb,CTA_PROTOINFO_TCP_MAX , cta_min_tcp)) +if (nlattr_bad_size (tb,CTA_PROTOINFO_TCP_MAX , cta_min_tcp))return -EINVAL ;if (!tb[CTA_PROTOINFO_TCP_STATE ])
@@ -1387,10 +1387,10 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4 __read_mostly = .new = tcp_new, .error = tcp_error,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .to_nfattr = tcp_to_nfattr, - .from_nfattr = nfattr_to_tcp, - .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, - .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, + .to_nlattr = tcp_to_nlattr, + .from_nlattr = nlattr_to_tcp, + .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, + .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &tcp_sysctl_table_users,
@@ -1416,10 +1416,10 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6 __read_mostly = .new = tcp_new, .error = tcp_error,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .to_nfattr = tcp_to_nfattr, - .from_nfattr = nfattr_to_tcp, - .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, - .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, + .to_nlattr = tcp_to_nlattr, + .from_nlattr = nlattr_to_tcp, + .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, + .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &tcp_sysctl_table_users,
net/netfilter/nf_conntrack_proto_udp.c +4 -4
@@ -203,8 +203,8 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly = .new = udp_new, .error = udp_error,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, - .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, + .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, + .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &udp_sysctl_table_users,
@@ -230,8 +230,8 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 __read_mostly = .new = udp_new, .error = udp_error,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, - .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, + .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, + .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &udp_sysctl_table_users,
net/netfilter/nf_conntrack_proto_udplite.c +4 -4
@@ -203,8 +203,8 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 __read_mostly = .new = udplite_new, .error = udplite_error,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, - .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, + .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, + .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &udplite_sysctl_table_users,
@@ -226,8 +226,8 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite6 __read_mostly = .new = udplite_new, .error = udplite_error,#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) - .tuple_to_nfattr = nf_ct_port_tuple_to_nfattr, - .nfattr_to_tuple = nf_ct_port_nfattr_to_tuple, + .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, + .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &udplite_sysctl_table_users,
net/netfilter/nfnetlink_log.c +1 -1
@@ -769,7 +769,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,UDEBUG ("entering for msg %u\n" ,NFNL_MSG_TYPE (nlh->nlmsg_type)); -if (nfattr_bad_size (nfula,NFULA_CFG_MAX , nfula_cfg_min)) { +if (nlattr_bad_size (nfula,NFULA_CFG_MAX , nfula_cfg_min)) {UDEBUG ("bad attribute size\n" );return -EINVAL ; }
net/netfilter/nfnetlink_queue.c +2 -2
@@ -796,7 +796,7 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,struct nfqnl_queue_entry *entry;int err; -if (nfattr_bad_size (nfqa,NFQA_MAX , nfqa_verdict_min)) { +if (nlattr_bad_size (nfqa,NFQA_MAX , nfqa_verdict_min)) {QDEBUG ("bad attribute size\n" );return -EINVAL ; }
@@ -876,7 +876,7 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,QDEBUG ("entering for msg %u\n" ,NFNL_MSG_TYPE (nlh->nlmsg_type)); -if (nfattr_bad_size (nfqa,NFQA_CFG_MAX , nfqa_cfg_min)) { +if (nlattr_bad_size (nfqa,NFQA_CFG_MAX , nfqa_cfg_min)) {QDEBUG ("bad attribute size\n" );return -EINVAL ; }
PATCH 4/19 : nfnetlink: use nlmsg_notify()
In reply to Patrick McHardy[NETFILTER]: nfnetlink: use nlmsg_notify()
---
commit 6e4c97ee8ad0d54a48057f7fd1ec4e7cd2571556
tree 2eef13fec6d3ba46845b3c7da26ae4811d3e80ef
parent 46958d51af5d65a36b04e8c8aabba6d86b19b4c7
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:13 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:13 +0200
net/netfilter/nfnetlink.c | 11 +---------- 1 files changed, 1 insertions(+), 10 deletions(-)
net/netfilter/nfnetlink.c +1 -10
@@ -148,16 +148,7 @@ EXPORT_SYMBOL_GPL(nfnetlink_has_listeners);int nfnetlink_send (struct sk_buff *skb,u32 pid,unsigned group,int echo) { -int err =0 ; - -NETLINK_CB (skb).dst_group = group; -if (echo) -atomic_inc (&skb->users); -netlink_broadcast (nfnl, skb, pid, group,gfp_any ()); -if (echo) - err =netlink_unicast (nfnl, skb, pid,MSG_DONTWAIT ); - -return err; +return nlmsg_notify (nfnl, skb, pid, group, echo,gfp_any ()); }EXPORT_SYMBOL_GPL (nfnetlink_send);
PATCH 5/19 : nfnetlink: support attribute policies
In reply to Patrick McHardy[NETFILTER]: nfnetlink: support attribute policies
Add support for automatic checking of per-callback attribute policies.
---
commit 77f03e3cfbe5b876031f757f2af2b55c568b0d34
tree 2347ecf9e7a9f8a64f9c8692f5fc3fcda00a7367
parent 6e4c97ee8ad0d54a48057f7fd1ec4e7cd2571556
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:13 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:13 +0200
include/linux/netfilter/nfnetlink.h | 3 +- net/netfilter/nfnetlink.c | 48 +++++++++-------------------------- 2 files changed, 15 insertions(+), 36 deletions(-)
include/linux/netfilter/nfnetlink.h +2 -1
@@ -58,7 +58,8 @@ struct nfnl_callback {int (*call)(struct sock *nl,struct sk_buff *skb,struct nlmsghdr *nlh,struct nlattr *cda[]); -u_int16_t attr_count;/* number of nlattr's */ +const struct nla_policy *policy;/* netlink attribute policy */ +const u_int16_t attr_count;/* number of nlattr's */ };struct nfnetlink_subsystem
net/netfilter/nfnetlink.c +13 -35
63 lines not on this page · raw message
PATCH 6/19 : nfnetlink_log: use netlink policy
In reply to Patrick McHardy[NETFILTER]: nfnetlink_log: use netlink policy
Also remove unused nfula_min array.
---
commit 66650816a6da2ae78bb68487e894922b7ba39942
tree 6272f8f7d19c05ebede69238b8f6c1e4fd60bdc9
parent 77f03e3cfbe5b876031f757f2af2b55c568b0d34
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:14 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:14 +0200
net/netfilter/nfnetlink_log.c | 38 +++++++++----------------------------- 1 files changed, 9 insertions(+), 29 deletions(-)
net/netfilter/nfnetlink_log.c +9 -29
@@ -733,29 +733,13 @@ static struct nf_logger nfulnl_logger = { .me = THIS_MODULE, }; -static const int nfula_min[NFULA_MAX +1 ] = { - [NFULA_PACKET_HDR ] =sizeof (struct nfulnl_msg_packet_hdr ), - [NFULA_MARK ] =sizeof (u_int32_t), - [NFULA_TIMESTAMP ] =sizeof (struct nfulnl_msg_packet_timestamp ), - [NFULA_IFINDEX_INDEV ] =sizeof (u_int32_t), - [NFULA_IFINDEX_OUTDEV ] =sizeof (u_int32_t), - [NFULA_IFINDEX_PHYSINDEV ] =sizeof (u_int32_t), - [NFULA_IFINDEX_PHYSOUTDEV ] =sizeof (u_int32_t), - [NFULA_HWADDR ] =sizeof (struct nfulnl_msg_packet_hw ), - [NFULA_PAYLOAD ] =0 , - [NFULA_PREFIX ] =0 , - [NFULA_UID ] =sizeof (u_int32_t), - [NFULA_SEQ ] =sizeof (u_int32_t), - [NFULA_SEQ_GLOBAL ] =sizeof (u_int32_t), -}; - -static const int nfula_cfg_min[NFULA_CFG_MAX +1 ] = { - [NFULA_CFG_CMD ] =sizeof (struct nfulnl_msg_config_cmd ), - [NFULA_CFG_MODE ] =sizeof (struct nfulnl_msg_config_mode ), - [NFULA_CFG_TIMEOUT ] =sizeof (u_int32_t), - [NFULA_CFG_QTHRESH ] =sizeof (u_int32_t), - [NFULA_CFG_NLBUFSIZ ] =sizeof (u_int32_t), - [NFULA_CFG_FLAGS ] =sizeof (u_int16_t), +static const struct nla_policy nfula_cfg_policy[NFULA_CFG_MAX +1 ] = { + [NFULA_CFG_CMD ] = { .len =sizeof (struct nfulnl_msg_config_cmd ) }, + [NFULA_CFG_MODE ] = { .len =sizeof (struct nfulnl_msg_config_mode ) }, + [NFULA_CFG_TIMEOUT ] = { .type =NLA_U32 }, + [NFULA_CFG_QTHRESH ] = { .type =NLA_U32 }, + [NFULA_CFG_NLBUFSIZ ] = { .type =NLA_U32 }, + [NFULA_CFG_FLAGS ] = { .type =NLA_U16 }, }; static int
@@ -769,11 +753,6 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,UDEBUG ("entering for msg %u\n" ,NFNL_MSG_TYPE (nlh->nlmsg_type)); -if (nlattr_bad_size (nfula,NFULA_CFG_MAX , nfula_cfg_min)) { -UDEBUG ("bad attribute size\n" ); -return -EINVAL ; - } - inst =instance_lookup_get (group_num);if (nfula[NFULA_CFG_CMD ]) {u_int8_t pf = nfmsg->nfgen_family;
@@ -886,7 +865,8 @@ static const struct nfnl_callback nfulnl_cb[NFULNL_MSG_MAX] = { [NFULNL_MSG_PACKET ] = { .call = nfulnl_recv_unsupp, .attr_count = NFULA_MAX, }, [NFULNL_MSG_CONFIG ] = { .call = nfulnl_recv_config, - .attr_count = NFULA_CFG_MAX, }, + .attr_count =NFULA_CFG_MAX , + .policy = nfula_cfg_policy }, };static const struct nfnetlink_subsystem nfulnl_subsys = {
PATCH 7/19 : nfnetlink_queue: use netlink policy
In reply to Patrick McHardy[NETFILTER]: nfnetlink_queue: use netlink policy
---
commit 697cfea5ad56bc42a46706acd713cdad23f55f27
tree 5d2a14298de067a6f480349c4f0da7a13bf21e6a
parent 66650816a6da2ae78bb68487e894922b7ba39942
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:14 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:14 +0200
net/netfilter/nfnetlink_queue.c | 30 +++++++++++------------------- 1 files changed, 11 insertions(+), 19 deletions(-)
net/netfilter/nfnetlink_queue.c +11 -19
@@ -777,10 +777,10 @@ static struct notifier_block nfqnl_rtnl_notifier = { .notifier_call = nfqnl_rcv_nl_event, }; -static const int nfqa_verdict_min[NFQA_MAX +1 ] = { - [NFQA_VERDICT_HDR ] =sizeof (struct nfqnl_msg_verdict_hdr ), - [NFQA_MARK ] =sizeof (u_int32_t), - [NFQA_PAYLOAD ] =0 , +static const struct nla_policy nfqa_verdict_policy[NFQA_MAX +1 ] = { + [NFQA_VERDICT_HDR ] = { .len =sizeof (struct nfqnl_msg_verdict_hdr ) }, + [NFQA_MARK ] = { .type =NLA_U32 }, + [NFQA_PAYLOAD ] = { .type =NLA_UNSPEC }, }; static int
@@ -796,11 +796,6 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,struct nfqnl_queue_entry *entry;int err; -if (nlattr_bad_size (nfqa,NFQA_MAX , nfqa_verdict_min)) { -QDEBUG ("bad attribute size\n" ); -return -EINVAL ; - } - queue =instance_lookup_get (queue_num);if (!queue)return -ENODEV ;
@@ -855,9 +850,9 @@ nfqnl_recv_unsupp(struct sock *ctnl, struct sk_buff *skb,return -ENOTSUPP ; } -static const int nfqa_cfg_min[NFQA_CFG_MAX +1 ] = { - [NFQA_CFG_CMD ] =sizeof (struct nfqnl_msg_config_cmd ), - [NFQA_CFG_PARAMS ] =sizeof (struct nfqnl_msg_config_params ), +static const struct nla_policy nfqa_cfg_policy[NFQA_CFG_MAX +1 ] = { + [NFQA_CFG_CMD ] = { .len =sizeof (struct nfqnl_msg_config_cmd ) }, + [NFQA_CFG_PARAMS ] = { .len =sizeof (struct nfqnl_msg_config_params ) }, };static struct nf_queue_handler nfqh = {
@@ -876,11 +871,6 @@ nfqnl_recv_config(struct sock *ctnl, struct sk_buff *skb,QDEBUG ("entering for msg %u\n" ,NFNL_MSG_TYPE (nlh->nlmsg_type)); -if (nlattr_bad_size (nfqa,NFQA_CFG_MAX , nfqa_cfg_min)) { -QDEBUG ("bad attribute size\n" ); -return -EINVAL ; - } - queue =instance_lookup_get (queue_num);if (nfqa[NFQA_CFG_CMD ]) {struct nfqnl_msg_config_cmd *cmd;
@@ -964,9 +954,11 @@ static const struct nfnl_callback nfqnl_cb[NFQNL_MSG_MAX] = { [NFQNL_MSG_PACKET ] = { .call = nfqnl_recv_unsupp, .attr_count = NFQA_MAX, }, [NFQNL_MSG_VERDICT ] = { .call = nfqnl_recv_verdict, - .attr_count = NFQA_MAX, }, + .attr_count =NFQA_MAX , + .policy = nfqa_verdict_policy }, [NFQNL_MSG_CONFIG ] = { .call = nfqnl_recv_config, - .attr_count = NFQA_CFG_MAX, }, + .attr_count =NFQA_CFG_MAX , + .policy = nfqa_cfg_policy }, };static const struct nfnetlink_subsystem nfqnl_subsys = {
PATCH 8/19 : ctnetlink: use netlink policy
In reply to Patrick McHardy[NETFILTER]: ctnetlink: use netlink policy
---
commit e15d4b6820d941fdec349fba9b5800c366f1e4c1
tree b509cb5af053c35a298d581e32734be77dedcfe9
parent 697cfea5ad56bc42a46706acd713cdad23f55f27
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:15 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:15 +0200
include/net/netfilter/nf_conntrack_l3proto.h | 2 include/net/netfilter/nf_conntrack_l4proto.h | 3 + net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 10 +- net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 12 +-- net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c | 10 +- net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 12 +-- net/netfilter/nf_conntrack_core.c | 10 +- net/netfilter/nf_conntrack_netlink.c | 111 +++++++++++------------- net/netfilter/nf_conntrack_proto_gre.c | 1 net/netfilter/nf_conntrack_proto_tcp.c | 22 +++-- net/netfilter/nf_conntrack_proto_udp.c | 2 net/netfilter/nf_conntrack_proto_udplite.c | 2 12 files changed, 97 insertions(+), 100 deletions(-)
include/net/netfilter/nf_conntrack_l3proto.h +2 -0
@@ -12,6 +12,7 @@#ifndef _NF_CONNTRACK_L3PROTO_H#define _NF_CONNTRACK_L3PROTO_H#include <linux/netlink.h> +#include <net/netlink.h> #include <linux/seq_file.h> #include <net/netfilter/nf_conntrack.h>
@@ -68,6 +69,7 @@ struct nf_conntrack_l3protoint (*nlattr_to_tuple)(struct nlattr *tb[],struct nf_conntrack_tuple *t); +const struct nla_policy *nla_policy;#ifdef CONFIG_SYSCTL struct ctl_table_header *ctl_table_header;
include/net/netfilter/nf_conntrack_l4proto.h +3 -0
@@ -10,6 +10,7 @@#ifndef _NF_CONNTRACK_L4PROTO_H#define _NF_CONNTRACK_L4PROTO_H#include <linux/netlink.h> +#include <net/netlink.h> #include <net/netfilter/nf_conntrack.h> struct seq_file ;
@@ -75,6 +76,7 @@ struct nf_conntrack_l4proto const struct nf_conntrack_tuple *t);int (*nlattr_to_tuple)(struct nlattr *tb[],struct nf_conntrack_tuple *t); +const struct nla_policy *nla_policy;#ifdef CONFIG_SYSCTL struct ctl_table_header **ctl_table_header;
@@ -115,6 +117,7 @@ extern int nf_ct_port_tuple_to_nlattr(struct sk_buff *skb, const struct nf_conntrack_tuple *tuple);extern int nf_ct_port_nlattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t); +extern const struct nla_policy nf_ct_port_nla_policy[];/* Log invalid packets */ extern unsigned int nf_ct_log_invalid;
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +4 -6
@@ -373,9 +373,9 @@ nla_put_failure:return -1 ; } -static const size_t cta_min_ip[CTA_IP_MAX +1 ] = { - [CTA_IP_V4_SRC ] =sizeof (u_int32_t), - [CTA_IP_V4_DST ] =sizeof (u_int32_t), +static const struct nla_policy ipv4_nla_policy[CTA_IP_MAX +1 ] = { + [CTA_IP_V4_SRC ] = { .type =NLA_U32 }, + [CTA_IP_V4_DST ] = { .type =NLA_U32 }, }; static int ipv4_nlattr_to_tuple(struct nlattr *tb[],
@@ -384,9 +384,6 @@ static int ipv4_nlattr_to_tuple(struct nlattr *tb[],if (!tb[CTA_IP_V4_SRC ] || !tb[CTA_IP_V4_DST ])return -EINVAL ; -if (nlattr_bad_size (tb,CTA_IP_MAX , cta_min_ip)) -return -EINVAL ; - t->src.u3.ip = *(__be32 *)nla_data (tb[CTA_IP_V4_SRC ]); t->dst.u3.ip = *(__be32 *)nla_data (tb[CTA_IP_V4_DST ]);
@@ -413,6 +410,7 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = {#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = ipv4_tuple_to_nlattr, .nlattr_to_tuple = ipv4_nlattr_to_tuple, + .nla_policy = ipv4_nla_policy,#endif #if defined(CONFIG_SYSCTL ) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT ) .ctl_table_path = nf_net_ipv4_netfilter_sysctl_path,
net/ipv4/netfilter/nf_conntrack_proto_icmp.c +5 -7
@@ -248,10 +248,10 @@ nla_put_failure:return -1 ; } -static const size_t cta_min_proto[CTA_PROTO_MAX +1 ] = { - [CTA_PROTO_ICMP_TYPE ] =sizeof (u_int8_t), - [CTA_PROTO_ICMP_CODE ] =sizeof (u_int8_t), - [CTA_PROTO_ICMP_ID ] =sizeof (u_int16_t) +static const struct nla_policy icmp_nla_policy[CTA_PROTO_MAX +1 ] = { + [CTA_PROTO_ICMP_TYPE ] = { .type =NLA_U8 }, + [CTA_PROTO_ICMP_CODE ] = { .type =NLA_U8 }, + [CTA_PROTO_ICMP_ID ] = { .type =NLA_U16 }, }; static int icmp_nlattr_to_tuple(struct nlattr *tb[],
@@ -262,9 +262,6 @@ static int icmp_nlattr_to_tuple(struct nlattr *tb[], || !tb[CTA_PROTO_ICMP_ID])return -EINVAL ; -if (nlattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto)) -return -EINVAL ; - tuple->dst.u.icmp.type = *(u_int8_t *)nla_data (tb[CTA_PROTO_ICMP_TYPE ]); tuple->dst.u.icmp.code =
@@ -329,6 +326,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp __read_mostly =#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = icmp_tuple_to_nlattr, .nlattr_to_tuple = icmp_nlattr_to_tuple, + .nla_policy = icmp_nla_policy,#endif #ifdef CONFIG_SYSCTL .ctl_table_header = &icmp_sysctl_header,
net/ipv6/netfilter/nf_conntrack_l3proto_ipv6.c +4 -6
@@ -350,9 +350,9 @@ nla_put_failure:return -1 ; } -static const size_t cta_min_ip[CTA_IP_MAX +1 ] = { - [CTA_IP_V6_SRC ] =sizeof (u_int32_t)*4 , - [CTA_IP_V6_DST ] =sizeof (u_int32_t)*4 , +static const struct nla_policy ipv6_nla_policy[CTA_IP_MAX +1 ] = { + [CTA_IP_V6_SRC ] = { .len =sizeof (u_int32_t)*4 }, + [CTA_IP_V6_DST ] = { .len =sizeof (u_int32_t)*4 }, }; static int ipv6_nlattr_to_tuple(struct nlattr *tb[],
@@ -361,9 +361,6 @@ static int ipv6_nlattr_to_tuple(struct nlattr *tb[],if (!tb[CTA_IP_V6_SRC ] || !tb[CTA_IP_V6_DST ])return -EINVAL ; -if (nlattr_bad_size (tb,CTA_IP_MAX , cta_min_ip)) -return -EINVAL ; -memcpy (&t->src.u3.ip6,nla_data (tb[CTA_IP_V6_SRC ]),sizeof (u_int32_t) *4 ); memcpy(&t->dst.u3.ip6, nla_data(tb[CTA_IP_V6_DST]),
@@ -384,6 +381,7 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv6 __read_mostly = {#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = ipv6_tuple_to_nlattr, .nlattr_to_tuple = ipv6_nlattr_to_tuple, + .nla_policy = ipv6_nla_policy,#endif #ifdef CONFIG_SYSCTL .ctl_table_path = nf_net_netfilter_sysctl_path,
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +5 -7
@@ -226,10 +226,10 @@ nla_put_failure:return -1 ; } -static const size_t cta_min_proto[CTA_PROTO_MAX +1 ] = { - [CTA_PROTO_ICMPV6_TYPE ] =sizeof (u_int8_t), - [CTA_PROTO_ICMPV6_CODE ] =sizeof (u_int8_t), - [CTA_PROTO_ICMPV6_ID ] =sizeof (u_int16_t) +static const struct nla_policy icmpv6_nla_policy[CTA_PROTO_MAX +1 ] = { + [CTA_PROTO_ICMPV6_TYPE ] = { .type =NLA_U8 }, + [CTA_PROTO_ICMPV6_CODE ] = { .type =NLA_U8 }, + [CTA_PROTO_ICMPV6_ID ] = { .type =NLA_U16 }, }; static int icmpv6_nlattr_to_tuple(struct nlattr *tb[],
@@ -240,9 +240,6 @@ static int icmpv6_nlattr_to_tuple(struct nlattr *tb[], || !tb[CTA_PROTO_ICMPV6_ID])return -EINVAL ; -if (nlattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto)) -return -EINVAL ; - tuple->dst.u.icmp.type = *(u_int8_t *)nla_data (tb[CTA_PROTO_ICMPV6_TYPE ]); tuple->dst.u.icmp.code =
@@ -291,6 +288,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmpv6 __read_mostly =#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = icmpv6_tuple_to_nlattr, .nlattr_to_tuple = icmpv6_nlattr_to_tuple, + .nla_policy = icmpv6_nla_policy,#endif #ifdef CONFIG_SYSCTL .ctl_table_header = &icmpv6_sysctl_header,
net/netfilter/nf_conntrack_core.c +4 -6
@@ -844,10 +844,11 @@ nla_put_failure: }EXPORT_SYMBOL_GPL (nf_ct_port_tuple_to_nlattr); -static const size_t cta_min_proto[CTA_PROTO_MAX +1 ] = { - [CTA_PROTO_SRC_PORT ] =sizeof (u_int16_t), - [CTA_PROTO_DST_PORT ] =sizeof (u_int16_t) +const struct nla_policy nf_ct_port_nla_policy[CTA_PROTO_MAX +1 ] = { + [CTA_PROTO_SRC_PORT ] = { .type =NLA_U16 }, + [CTA_PROTO_DST_PORT ] = { .type =NLA_U16 }, }; +EXPORT_SYMBOL_GPL (nf_ct_port_nla_policy);int nf_ct_port_nlattr_to_tuple (struct nlattr *tb[],struct nf_conntrack_tuple *t)
@@ -855,9 +856,6 @@ int nf_ct_port_nlattr_to_tuple(struct nlattr *tb[],if (!tb[CTA_PROTO_SRC_PORT ] || !tb[CTA_PROTO_DST_PORT ])return -EINVAL ; -if (nlattr_bad_size (tb,CTA_PROTO_MAX , cta_min_proto)) -return -EINVAL ; - t->src.u.tcp.port = *(__be16 *)nla_data (tb[CTA_PROTO_SRC_PORT ]); t->dst.u.tcp.port = *(__be16 *)nla_data (tb[CTA_PROTO_DST_PORT ]);
net/netfilter/nf_conntrack_netlink.c +53 -58
223 lines not on this page · raw message
net/netfilter/nf_conntrack_proto_gre.c +1 -0
@@ -276,6 +276,7 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_gre4 __read_mostly = {#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, + .nla_policy = nf_ct_port_nla_policy,#endif };
net/netfilter/nf_conntrack_proto_tcp.c +12 -10
@@ -1105,28 +1105,28 @@ nla_put_failure:return -1 ; } -static const size_t cta_min_tcp[CTA_PROTOINFO_TCP_MAX +1 ] = { - [CTA_PROTOINFO_TCP_STATE ] =sizeof (u_int8_t), - [CTA_PROTOINFO_TCP_WSCALE_ORIGINAL ] =sizeof (u_int8_t), - [CTA_PROTOINFO_TCP_WSCALE_REPLY ] =sizeof (u_int8_t), - [CTA_PROTOINFO_TCP_FLAGS_ORIGINAL ] =sizeof (struct nf_ct_tcp_flags ), - [CTA_PROTOINFO_TCP_FLAGS_REPLY ] =sizeof (struct nf_ct_tcp_flags ) +static const struct nla_policy tcp_nla_policy[CTA_PROTOINFO_TCP_MAX +1 ] = { + [CTA_PROTOINFO_TCP_STATE ] = { .type =NLA_U8 }, + [CTA_PROTOINFO_TCP_WSCALE_ORIGINAL ] = { .type =NLA_U8 }, + [CTA_PROTOINFO_TCP_WSCALE_REPLY ] = { .type =NLA_U8 }, + [CTA_PROTOINFO_TCP_FLAGS_ORIGINAL ] = { .len =sizeof (struct nf_ct_tcp_flags ) }, + [CTA_PROTOINFO_TCP_FLAGS_REPLY ] = { .len =sizeof (struct nf_ct_tcp_flags ) }, };static int nlattr_to_tcp (struct nlattr *cda[],struct nf_conn *ct) {struct nlattr *attr = cda[CTA_PROTOINFO_TCP ];struct nlattr *tb[CTA_PROTOINFO_TCP_MAX +1 ]; +int err;/* updates could not contain anything about the private * protocol info, in that case skip the parsing */ if (!attr)return 0 ; -nla_parse_nested (tb,CTA_PROTOINFO_TCP_MAX , attr,NULL ); - -if (nlattr_bad_size (tb,CTA_PROTOINFO_TCP_MAX , cta_min_tcp)) -return -EINVAL ; + err =nla_parse_nested (tb,CTA_PROTOINFO_TCP_MAX , attr, tcp_nla_policy); +if (err <0 ) +return err;if (!tb[CTA_PROTOINFO_TCP_STATE ])return -EINVAL ;
@@ -1391,6 +1391,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp4 __read_mostly = .from_nlattr = nlattr_to_tcp, .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, + .nla_policy = nf_ct_port_nla_policy,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &tcp_sysctl_table_users,
@@ -1420,6 +1421,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_tcp6 __read_mostly = .from_nlattr = nlattr_to_tcp, .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, + .nla_policy = nf_ct_port_nla_policy,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &tcp_sysctl_table_users,
net/netfilter/nf_conntrack_proto_udp.c +2 -0
@@ -205,6 +205,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp4 __read_mostly =#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, + .nla_policy = nf_ct_port_nla_policy,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &udp_sysctl_table_users,
@@ -232,6 +233,7 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_udp6 __read_mostly =#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, + .nla_policy = nf_ct_port_nla_policy,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &udp_sysctl_table_users,
net/netfilter/nf_conntrack_proto_udplite.c +2 -0
@@ -205,6 +205,7 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite4 __read_mostly =#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, + .nla_policy = nf_ct_port_nla_policy,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &udplite_sysctl_table_users,
@@ -228,6 +229,7 @@ static struct nf_conntrack_l4proto nf_conntrack_l4proto_udplite6 __read_mostly =#if defined(CONFIG_NF_CT_NETLINK ) || defined(CONFIG_NF_CT_NETLINK_MODULE ) .tuple_to_nlattr = nf_ct_port_tuple_to_nlattr, .nlattr_to_tuple = nf_ct_port_nlattr_to_tuple, + .nla_policy = nf_ct_port_nla_policy,#endif #ifdef CONFIG_SYSCTL .ctl_table_users = &udplite_sysctl_table_users,
PATCH 9/19 : nfnetlink: kill nlattr_bad_size
In reply to Patrick McHardy[NETFILTER]: nfnetlink: kill nlattr_bad_size
---
commit 3dd95b7cdecd16519f2e76e2439953d6b50330c3
tree 230be6308f1a823db8f53ae3f1cc3b35731fc97c
parent e15d4b6820d941fdec349fba9b5800c366f1e4c1
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:15 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:15 +0200
include/linux/netfilter/nfnetlink.h | 13 ------------- 1 files changed, 0 insertions(+), 13 deletions(-)
include/linux/netfilter/nfnetlink.h +0 -13
@@ -73,19 +73,6 @@ struct nfnetlink_subsystemextern int nfnetlink_subsys_register (const struct nfnetlink_subsystem *n);extern int nfnetlink_subsys_unregister (const struct nfnetlink_subsystem *n); -#define nlattr_bad_size (tb, max, cta_min) \ -({ int __i, __res = 0; \ - for (__i=1; __i <= max; __i++) { \ - if (!cta_min[__i]) \ - continue; \ - if (tb[__i] && nla_len(tb[__i]) < cta_min[__i]){ \ - __res = 1; \ - break; \ - } \ - } \ - __res; \ -}) -extern int nfnetlink_has_listeners (unsigned int group);extern int nfnetlink_send (struct sk_buff *skb,u32 pid,unsigned group,int echo);
PATCH 10/19 : nf_conntrack: kill unique ID
In reply to Patrick McHardy[NETFILTER]: nf_conntrack: kill unique ID
Remove the per-conntrack ID, its not necessary anymore for dumping. For compatiblity reasons we send the address of the conntrack to userspace as ID.
---
commit 02887778f4c84cff4b5d5526307552bda8673e2a
tree c47227f9ebbe036489392d2beab8be262835a963
parent 3dd95b7cdecd16519f2e76e2439953d6b50330c3
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:16 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:16 +0200
include/net/netfilter/nf_conntrack.h | 3 --- net/netfilter/nf_conntrack_core.c | 2 -- net/netfilter/nf_conntrack_netlink.c | 4 ++-- 3 files changed, 2 insertions(+), 7 deletions(-)
include/net/netfilter/nf_conntrack.h +0 -3
@@ -116,9 +116,6 @@ struct nf_connstruct ip_conntrack_counter counters[IP_CT_DIR_MAX ];#endif -/* Unique ID that identifies this conntrack*/ -unsigned int id; -#if defined(CONFIG_NF_CONNTRACK_MARK )u_int32_t mark;#endif
net/netfilter/nf_conntrack_core.c +0 -2
@@ -63,7 +63,6 @@ unsigned int nf_ct_log_invalid __read_mostly;HLIST_HEAD (unconfirmed);static int nf_conntrack_vmalloc__read_mostly ;static struct kmem_cache *nf_conntrack_cachep__read_mostly ; -static unsigned int nf_conntrack_next_id; DEFINE_PER_CPU(struct ip_conntrack_stat, nf_conntrack_stat);EXPORT_PER_CPU_SYMBOL (nf_conntrack_stat);
@@ -287,7 +286,6 @@ static void __nf_conntrack_hash_insert(struct nf_conn *ct,unsigned int hash, unsigned int repl_hash) { - ct->id = ++nf_conntrack_next_id; hlist_add_head(&ct->tuplehash[IP_CT_DIR_ORIGINAL].hnode, &nf_conntrack_hash[hash]); hlist_add_head(&ct->tuplehash[IP_CT_DIR_REPLY].hnode,
net/netfilter/nf_conntrack_netlink.c +2 -2
@@ -257,7 +257,7 @@ nla_put_failure:static inline int ctnetlink_dump_id (struct sk_buff *skb,const struct nf_conn *ct) { -__be32 id =htonl (ct->id); +__be32 id =htonl ((unsigned long )ct);NLA_PUT (skb,CTA_ID ,sizeof (u_int32_t), &id);return 0 ;
@@ -723,7 +723,7 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,if (cda[CTA_ID ]) {u_int32_t id =ntohl (*(__be32 *)nla_data (cda[CTA_ID ])); -if (ct->id != id) { +if (id != (u32 )(unsigned long )ct) {nf_ct_put (ct);return -ENOENT ; }
PATCH 11/19 : nf_conntrack_expect: kill unique ID
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_expect: kill unique ID
Similar to the conntrack ID, the per-expectation ID is not needed anymore, kill it.
---
commit e4c32368714870c516b5ec7abbb22c1fe8a80feb
tree 16e24d94bfa360db24e731c17ed6970070cd1c1b
parent 02887778f4c84cff4b5d5526307552bda8673e2a
author Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:16 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:16 +0200
include/net/netfilter/nf_conntrack_expect.h | 3 --- net/netfilter/nf_conntrack_expect.c | 2 -- net/netfilter/nf_conntrack_netlink.c | 6 +++--- 3 files changed, 3 insertions(+), 8 deletions(-)
include/net/netfilter/nf_conntrack_expect.h +0 -3
@@ -38,9 +38,6 @@ struct nf_conntrack_expect/* Usage count. */ atomic_t use; -/* Unique ID */ -unsigned int id; -/* Flags */ unsigned int flags;
net/netfilter/nf_conntrack_expect.c +0 -2
@@ -41,7 +41,6 @@ static int nf_ct_expect_hash_rnd_initted __read_mostly;static int nf_ct_expect_vmalloc;static struct kmem_cache *nf_ct_expect_cachep__read_mostly ; -static unsigned int nf_ct_expect_next_id;/* nf_conntrack_expect helper functions */ void nf_ct_unlink_expect (struct nf_conntrack_expect *exp)
@@ -302,7 +301,6 @@ static void nf_ct_expect_insert(struct nf_conntrack_expect *exp) exp->timeout.expires = jiffies + master_help->helper->timeout *HZ ;add_timer (&exp->timeout); - exp->id = ++nf_ct_expect_next_id;atomic_inc (&exp->use);NF_CT_STAT_INC (expect_create); }
net/netfilter/nf_conntrack_netlink.c +3 -3
@@ -1160,7 +1160,7 @@ ctnetlink_exp_dump_expect(struct sk_buff *skb, {struct nf_conn *master = exp->master;__be32 timeout =htonl ((exp->timeout.expires - jiffies) /HZ ); -__be32 id =htonl (exp->id); +__be32 id =htonl ((unsigned long )exp);if (ctnetlink_exp_dump_tuple (skb, &exp->tuple,CTA_EXPECT_TUPLE ) <0 ) goto nla_put_failure;
@@ -1346,7 +1346,7 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,if (cda[CTA_EXPECT_ID ]) {__be32 id = *(__be32 *)nla_data (cda[CTA_EXPECT_ID ]); -if (exp->id !=ntohl (id)) { +if (ntohl (id) != (u32 )(unsigned long )exp) {nf_ct_expect_put (exp);return -ENOENT ; }
@@ -1400,7 +1400,7 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,if (cda[CTA_EXPECT_ID ]) {__be32 id = *(__be32 *)nla_data (cda[CTA_EXPECT_ID ]); -if (exp->id !=ntohl (id)) { +if (ntohl (id) != (u32 )(unsigned long )exp) {nf_ct_expect_put (exp);return -ENOENT ; }
PATCH 12/19 : nf_conntrack_netlink: add support to related connections
In reply to Patrick McHardy[NETFILTER]: nf_conntrack_netlink: add support to related connections
This patch adds support to relate a connection to an existing master connection. This patch is used by conntrackd to correctly replicate related connections.
---
commit b7ee1904c7e1e916c8a5f3cae94ef302ed59daf2
tree 757969dd0db39b7af43e88000cce06b72fb9daf4
parent e4c32368714870c516b5ec7abbb22c1fe8a80feb
author Pablo Neira Ayuso <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200
include/linux/netfilter/nfnetlink_conntrack.h | 1 + net/netfilter/nf_conntrack_netlink.c | 43 +++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 3 deletions(-)
include/linux/netfilter/nfnetlink_conntrack.h +1 -0
@@ -36,6 +36,7 @@ enum ctattr_type {CTA_USE ,CTA_ID ,CTA_NAT_DST , +CTA_TUPLE_MASTER , __CTA_MAX };#define CTA_MAX (__CTA_MAX - 1)
net/netfilter/nf_conntrack_netlink.c +40 -3
76 lines not on this page · raw message
PATCH 13/19 : nfnetlink_log: kill duplicate code
In reply to Patrick McHardy[NETFILTER]: nfnetlink_log: kill duplicate code
Kill some cut'n'paste effect.
Just after __nfulnl_send() returning, inst->skb is always NULL.
---
commit 7b32724f5d944727be7dcf23b50feb233d11be3f
tree 47f0e3720d7b26d4b6ead95aab155880e19e71de
parent b7ee1904c7e1e916c8a5f3cae94ef302ed59daf2
author Michal Miroslaw <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200
net/netfilter/nfnetlink_log.c | 30 ++++++++++++++---------------- 1 files changed, 14 insertions(+), 16 deletions(-)
net/netfilter/nfnetlink_log.c +14 -16
@@ -188,7 +188,7 @@ out_unlock:return NULL ; } -static int __nfulnl_send (struct nfulnl_instance *inst); +static void __nfulnl_flush (struct nfulnl_instance *inst);static void __instance_destroy (struct nfulnl_instance *inst)
@@ -202,17 +202,8 @@ __instance_destroy(struct nfulnl_instance *inst)/* then flush all pending packets from skb */ spin_lock_bh (&inst->lock); -if (inst->skb) { -/* timer "holds" one reference (we have one more) */ -if (del_timer (&inst->timer)) -instance_put (inst); -if (inst->qlen) -__nfulnl_send (inst); -if (inst->skb) { -kfree_skb (inst->skb); - inst->skb =NULL ; - } - } +if (inst->skb) +__nfulnl_flush (inst);spin_unlock_bh (&inst->lock);/* and finally put the refcount */
@@ -364,6 +355,16 @@ nlmsg_failure:return status; } +static void +__nfulnl_flush (struct nfulnl_instance *inst) +{ +/* timer holds a reference */ +if (del_timer (&inst->timer)) +instance_put (inst); +if (inst->skb) +__nfulnl_send (inst); +} +static void nfulnl_timer (unsigned long data) {struct nfulnl_instance *inst = (struct nfulnl_instance *)data;
@@ -650,10 +651,7 @@ nfulnl_log_packet(unsigned int pf,* enough room in the skb left. flush to userspace. */ UDEBUG ("flushing old skb\n" ); -/* timer "holds" one reference (we have another one) */ -if (del_timer (&inst->timer)) -instance_put (inst); -__nfulnl_send (inst); +__nfulnl_flush (inst); }if (!inst->skb) {
PATCH 14/19 : nfnetlink_log: flush queue early
In reply to Patrick McHardy[NETFILTER]: nfnetlink_log: flush queue early
If queue is filled to its threshold, then flush it right away instead of waiting for timer or next packet.
---
commit 073e73c1745332ab4e1765041847be760f366f53
tree 5327f298fd041b02c5635d93cf935e266644b90d
parent 7b32724f5d944727be7dcf23b50feb233d11be3f
author Michal Miroslaw <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200
net/netfilter/nfnetlink_log.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-)
net/netfilter/nfnetlink_log.c +5 -4
@@ -644,9 +644,8 @@ nfulnl_log_packet(unsigned int pf, goto unlock_and_release; } -if (inst->qlen >= qthreshold || - (inst->skb && size > -skb_tailroom (inst->skb) -sizeof (struct nfgenmsg ))) { +if (inst->skb && + size >skb_tailroom (inst->skb) -sizeof (struct nfgenmsg )) {/* either the queue len is too high or we don't have * enough room in the skb left. flush to userspace. */ UDEBUG ("flushing old skb\n" );
@@ -666,9 +665,11 @@ nfulnl_log_packet(unsigned int pf,__build_packet_message (inst, skb, data_len, pf, hooknum, in, out, li, prefix, plen); +if (inst->qlen >= qthreshold) +__nfulnl_flush (inst);/* timer_pending always called within inst->lock, so there * is no chance of a race here */ -if (!timer_pending (&inst->timer)) { +else if (!timer_pending (&inst->timer)) {instance_get (inst); inst->timer.expires = jiffies + (inst->flushtimeout*HZ /100 );add_timer (&inst->timer);
PATCH 15/19 : nfnetlink_log: fix style
In reply to Patrick McHardy[NETFILTER]: nfnetlink_log: fix style
Fix function definition style to match other functions in nfnetlink_log.c.
---
commit d18594f2d34d0751245bfbfec7e5f6d742775774
tree 1067caecf6ba0583cbc2bb1db90ffa59a124529e
parent 073e73c1745332ab4e1765041847be760f366f53
author Michal Miroslaw <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200
net/netfilter/nfnetlink_log.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
net/netfilter/nfnetlink_log.c +4 -3
@@ -301,8 +301,8 @@ nfulnl_set_flags(struct nfulnl_instance *inst, u_int16_t flags)return 0 ; } -static struct sk_buff *nfulnl_alloc_skb (unsigned int inst_size, -unsigned int pkt_size) +static struct sk_buff * +nfulnl_alloc_skb (unsigned int inst_size,unsigned int pkt_size) {struct sk_buff *skb;unsigned int n;
@@ -365,7 +365,8 @@ __nfulnl_flush(struct nfulnl_instance *inst)__nfulnl_send (inst); } -static void nfulnl_timer (unsigned long data) +static void +nfulnl_timer (unsigned long data) {struct nfulnl_instance *inst = (struct nfulnl_instance *)data;
PATCH 16/19 : nfnetlink_log: fix instance_create() failure path
In reply to Patrick McHardy[NETFILTER]: nfnetlink_log: fix instance_create() failure path
Fix memory leak on instance_create() while module is being unloaded.
---
commit 57a86b3a876463c836eff7cd75c77fef5f16c773
tree 27c2ce3e65b9b86d621f090b98e852c637eeb432
parent d18594f2d34d0751245bfbfec7e5f6d742775774
author Michal Miroslaw <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:17 +0200
net/netfilter/nfnetlink_log.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
net/netfilter/nfnetlink_log.c +5 -5
@@ -152,6 +152,11 @@ instance_create(u_int16_t group_num, int pid)if (!inst) goto out_unlock; +if (!try_module_get (THIS_MODULE )) { +kfree (inst); + goto out_unlock; + } +INIT_HLIST_NODE (&inst->hlist);spin_lock_init (&inst->lock);/* needs to be two, since we _put() after creation */
@@ -168,9 +173,6 @@ instance_create(u_int16_t group_num, int pid) inst->copy_mode =NFULNL_COPY_PACKET ; inst->copy_range =0xffff ; -if (!try_module_get (THIS_MODULE )) - goto out_free; -hlist_add_head (&inst->hlist, &instance_table[instance_hashfn (group_num)]);
@@ -181,8 +183,6 @@ instance_create(u_int16_t group_num, int pid)return inst; -out_free: -instance_put (inst); out_unlock:write_unlock_bh (&instances_lock);return NULL ;
PATCH 17/19 : nfnetlink_log: fix some constants
In reply to Patrick McHardy[NETFILTER]: nfnetlink_log: fix some constants
Fix timeout (one second is 1 * HZ) and convert max packet copy length to #defined constant.
---
commit caf9b335ee5b5e1c755170c85952b28208512489
tree 37e44cd0a6977e91b2055f5708274ffa9c414667
parent 57a86b3a876463c836eff7cd75c77fef5f16c773
author Michal Miroslaw <[email protected]> Fri, 28 Sep 2007 18:09:18 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:18 +0200
net/netfilter/nfnetlink_log.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-)
net/netfilter/nfnetlink_log.c +5 -7
@@ -37,8 +37,9 @@#endif #define NFULNL_NLBUFSIZ_DEFAULT NLMSG_GOODSIZE -#define NFULNL_TIMEOUT_DEFAULT 100/* every second */ +#define NFULNL_TIMEOUT_DEFAULT HZ/* every second */ #define NFULNL_QTHRESH_DEFAULT 100/* 100 packets */ +#define NFULNL_COPY_RANGE_MAX 0xFFFF/* max packet size is limited by 16-bit struct nfattr nfa_len field */ #define PRINTR(x, args...) do { if (net_ratelimit()) \ printk(x, ## args); } while (0);
@@ -171,7 +172,7 @@ instance_create(u_int16_t group_num, int pid) inst->flushtimeout =NFULNL_TIMEOUT_DEFAULT ; inst->nlbufsiz =NFULNL_NLBUFSIZ_DEFAULT ; inst->copy_mode =NFULNL_COPY_PACKET ; - inst->copy_range =0xffff ; + inst->copy_range =NFULNL_COPY_RANGE_MAX ;hlist_add_head (&inst->hlist, &instance_table[instance_hashfn (group_num)]);
@@ -235,11 +236,8 @@ nfulnl_set_mode(struct nfulnl_instance *inst, u_int8_t mode,case NFULNL_COPY_PACKET : inst->copy_mode = mode; -/* we're using struct nlattr which has 16bit nfa_len */ -if (range >0xffff ) - inst->copy_range =0xffff ; -else - inst->copy_range = range; + inst->copy_range = min_t(unsigned int, + range,NFULNL_COPY_RANGE_MAX );break ;default :
PATCH 18/19 : x_tables: add xt_time match
In reply to Patrick McHardy[NETFILTER]: x_tables: add xt_time match
This is ipt_time from POM-ng enhanced by the following:
* xtables/ipv6 support
* second granularity for daytime
* day-of-month support (for example "match on the 15th of each month")
* match against UTC or local timezone
---
commit b0a6584d6df0608e19c06edc42504aef7e58e213
tree f9ef14fdd2727a9828d4dbe1f52e3eaf97742fa5
parent caf9b335ee5b5e1c755170c85952b28208512489
author Jan Engelhardt <[email protected]> Fri, 28 Sep 2007 18:09:18 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:18 +0200
include/linux/netfilter/xt_time.h | 25 +++ net/netfilter/Kconfig | 14 ++ net/netfilter/Makefile | 1 net/netfilter/xt_time.c | 269 +++++++++++++++++++++++++++++++++++++ 4 files changed, 309 insertions(+), 0 deletions(-)
include/linux/netfilter/xt_time.h new file +25 -0
@@ -0,0 +1,25 @@ +#ifndef _XT_TIME_H +#define _XT_TIME_H 1 + +struct xt_time_info { +u_int32_t date_start; +u_int32_t date_stop; +u_int32_t daytime_start; +u_int32_t daytime_stop; +u_int32_t monthdays_match; +u_int8_t weekdays_match; +u_int8_t flags; +}; + +enum { +/* Match against local time (instead of UTC) */ +XT_TIME_LOCAL_TZ =1 <<0 , + +/* Shortcuts */ +XT_TIME_ALL_MONTHDAYS =0xFFFFFFFE , +XT_TIME_ALL_WEEKDAYS =0xFE , +XT_TIME_MIN_DAYTIME =0 , +XT_TIME_MAX_DAYTIME =24 *60 *60 -1 , +}; + +#endif /* _XT_TIME_H */
net/netfilter/Kconfig +14 -0
@@ -665,6 +665,20 @@ config NETFILTER_XT_MATCH_TCPMSS To compile it as a module, choose M here. If unsure, say N. +config NETFILTER_XT_MATCH_TIME + tristate '"time" match support' + depends on NETFILTER_XTABLES + ---help--- + This option adds a "time" match, which allows you to match based on + the packet arrival time (at the machine which netfilter is running) + on) or departure time/date (for locally generated packets). + + If you say Y here, try `iptables -m time --help` for + more information. + + If you want to compile it as a module, say M here. + If unsure, say N. + config NETFILTER_XT_MATCH_U32 tristate '"u32" match support' depends on NETFILTER_XTABLES
net/netfilter/Makefile +1 -0
@@ -73,6 +73,7 @@ obj-$(CONFIG_NETFILTER_XT_MATCH_SCTP) += xt_sctp.o obj-$(CONFIG_NETFILTER_XT_MATCH_STATE) += xt_state.o obj-$(CONFIG_NETFILTER_XT_MATCH_STATISTIC) += xt_statistic.o obj-$(CONFIG_NETFILTER_XT_MATCH_STRING) += xt_string.o +obj-$(CONFIG_NETFILTER_XT_MATCH_TIME) += xt_time.o obj-$(CONFIG_NETFILTER_XT_MATCH_TCPMSS) += xt_tcpmss.o obj-$(CONFIG_NETFILTER_XT_MATCH_PHYSDEV) += xt_physdev.o obj-$(CONFIG_NETFILTER_XT_MATCH_U32) += xt_u32.o
net/netfilter/xt_time.c new file +269 -0
269 lines not on this page · raw message
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH 19/19 : bridge: remove broken netfilter binary sysctls
In reply to Patrick McHardy[NETFILTER]: bridge: remove broken netfilter binary sysctls
The netfilter sysctls in the bridging code don't set strategy routines:
sysctl table check failed: /net/bridge/bridge-nf-call-arptables .3.10.1 Missing strategy sysctl table check failed: /net/bridge/bridge-nf-call-iptables .3.10.2 Missing strategy sysctl table check failed: /net/bridge/bridge-nf-call-ip6tables .3.10.3 Missing strategy sysctl table check failed: /net/bridge/bridge-nf-filter-vlan-tagged .3.10.4 Missing strategy sysctl table check failed: /net/bridge/bridge-nf-filter-pppoe-tagged .3.10.5 Missing strategy
These binary sysctls can't work. The binary sysctl numbers of
other netfilter sysctls with this problem are being removed. These need to go as well.
---
commit 313f81325be8fb197bd64c0647d3bb3c69876cb4
tree 6176c1ce4b3bce10abe5d6427ed39dcadd953c80
parent b0a6584d6df0608e19c06edc42504aef7e58e213
author Joseph Fannin <[email protected]> Fri, 28 Sep 2007 18:09:18 +0200 committer Patrick McHardy <[email protected]> Fri, 28 Sep 2007 18:09:18 +0200
net/bridge/br_netfilter.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
net/bridge/br_netfilter.c +0 -5
@@ -904,7 +904,6 @@ int brnf_sysctl_call_tables(ctl_table * ctl, int write, struct file *filp,static ctl_table brnf_table[] = { { - .ctl_name =NET_BRIDGE_NF_CALL_ARPTABLES , .procname ="bridge-nf-call-arptables" , .data = &brnf_call_arptables, .maxlen =sizeof (int ),
@@ -912,7 +911,6 @@ static ctl_table brnf_table[] = { .proc_handler = &brnf_sysctl_call_tables, }, { - .ctl_name = NET_BRIDGE_NF_CALL_IPTABLES, .procname = "bridge-nf-call-iptables", .data = &brnf_call_iptables, .maxlen = sizeof(int),
@@ -920,7 +918,6 @@ static ctl_table brnf_table[] = { .proc_handler = &brnf_sysctl_call_tables, }, { - .ctl_name = NET_BRIDGE_NF_CALL_IP6TABLES, .procname = "bridge-nf-call-ip6tables", .data = &brnf_call_ip6tables, .maxlen = sizeof(int),
@@ -928,7 +925,6 @@ static ctl_table brnf_table[] = { .proc_handler = &brnf_sysctl_call_tables, }, { - .ctl_name = NET_BRIDGE_NF_FILTER_VLAN_TAGGED, .procname = "bridge-nf-filter-vlan-tagged", .data = &brnf_filter_vlan_tagged, .maxlen = sizeof(int),
@@ -936,7 +932,6 @@ static ctl_table brnf_table[] = { .proc_handler = &brnf_sysctl_call_tables, }, { - .ctl_name = NET_BRIDGE_NF_FILTER_PPPOE_TAGGED, .procname = "bridge-nf-filter-pppoe-tagged", .data = &brnf_filter_pppoe_tagged, .maxlen = sizeof(int),
David Miller
maintainerFrom: Patrick McHardy <[email protected]>
Date: Fri, 28 Sep 2007 18:30:36 +0200 (MEST)
Quoted 7 lines
Hi Dave,
following is a netfilter update for 2.6.24, containing a set of patches to use the generic netlink functions for nfnetlink, a new "time" match, some
nfnetlink_logcleanups and some minor other stuff.Please apply, thanks.
All applied to net-2.6.24, thanks!