OpenVZ Forum - RDF feed
type: channel
items: [PATCH 1/5] netns netfilter: change xt_table_register() return value convention
items: Re: [PATCH 1/5] netns netfilter: change xt_table_register() return value convention

[PATCH 1/5] netns netfilter: change xt_table_register() return value convention
type: item
description: Switch from 0/-E to ptr/PTR_ERR convention. Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru> --- include/linux/netfilter/x_tables.h | 6 +++--- net/ipv4/netfilter/arp_tables.c | 7 ++++--- net/ipv4/netfilter/ip_tables.c | 7 ++++--- net/ipv6/netfilter/ip6_tables.c | 7 ++++--- net/netfilter/x_tables.c | 15 ++++++++------- 5 files changed, 23 insertions(+), 19 deletions(-) --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h @@ -335,9 +335,9 @@ extern int xt_check_target(const struct xt_target *target, unsigned short family unsigned int size, const char *table, unsigned int hook, unsigned short proto, int inv_proto); -extern int xt_register_table(struct xt_table *table, - struct xt_table_info *bootstrap, - struct xt_table_info *newinfo); +extern struct xt_table *xt_register_table(struct xt_table *table, + struct xt_table_info *bootstrap, + struct xt_table_info *newinfo); extern void *xt_unregister_table(struct xt_table *table); extern struct xt_table_info *xt_replace_table(struct xt_table *table, --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c @@ -1727,6 +1727,7 @@ int arpt_register_table(struct arpt_table *table, struct xt_table_info bootstrap = { 0, 0, 0, { 0 }, { 0 }, { } }; void *loc_cpu_entry; + struct xt_table *new_table; newinfo = xt_alloc_table_info(repl->size); if (!newinfo) { @@ -1750,10 +1751,10 @@ int arpt_register_table(struct arpt_table *table, return ret; } - ret = xt_register_table(table, &bootstrap, newinfo); - if (ret != 0) { + new_table = xt_register_table(table, &bootstrap, newinfo); + if (IS_ERR(new_table)) { xt_free_table_info(newinfo); - return ret; + return PTR_ERR(new_table); } return 0; --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c @@ -2055,6 +2055,7 @@ int ipt_register_table(struct xt_table *table, const struct ipt_replace *repl) struct xt_table_info bootstrap = { 0, 0, 0, { 0 }, { 0 }, { } }; void *loc_cpu_entry; + struct xt_table *new_table; newinfo = xt_allo…
creator: Alexey Dobriyan
date: 2008-01-21T14:52:05-00:00

Re: [PATCH 1/5] netns netfilter: change xt_table_register() return value convention
type: item
description: Alexey Dobriyan wrote: > Switch from 0/-E to ptr/PTR_ERR convention. Applied.
creator: Patrick McHardy
date: 2008-01-22T16:49:38-00:00