diff mbox

[nf-next,2/2] netfilter: nf_tables: Make sure the uniform style of condition blocks in nf_tables_newrule

Message ID 1482982798-24914-1-git-send-email-fgao@ikuai8.com
State Not Applicable
Delegated to: Pablo Neira
Headers show

Commit Message

高峰 Dec. 29, 2016, 3:39 a.m. UTC
From: Gao Feng <fgao@ikuai8.com>

There is one different brace style of condtion blocks in
nf_tables_newrule. Now just make it uniform.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
---
 net/netfilter/nf_tables_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Pablo Neira Ayuso Jan. 5, 2017, 12:34 p.m. UTC | #1
On Thu, Dec 29, 2016 at 11:39:58AM +0800, fgao@ikuai8.com wrote:
> From: Gao Feng <fgao@ikuai8.com>
> 
> There is one different brace style of condtion blocks in
> nf_tables_newrule. Now just make it uniform.
> 
> Signed-off-by: Gao Feng <fgao@ikuai8.com>
> ---
>  net/netfilter/nf_tables_api.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
> index ecc516c..7ac2b2e 100644
> --- a/net/netfilter/nf_tables_api.c
> +++ b/net/netfilter/nf_tables_api.c
> @@ -2261,12 +2261,12 @@ static int nf_tables_newrule(struct net *net, struct sock *nlsk,
>  			err = -ENOENT;
>  			goto err2;
>  		}
> -	} else if (nlh->nlmsg_flags & NLM_F_APPEND)
> +	} else if (nlh->nlmsg_flags & NLM_F_APPEND) {
>  		if (old_rule)
>  			list_add_rcu(&rule->list, &old_rule->list);
>  		else
>  			list_add_tail_rcu(&rule->list, &chain->rules);
> -	else {
> +	} else {

Thanks for the cleanup. But I have patch revisiting this logic still
cooking, so I'll add these braces there so we can skip this cleanup patch.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index ecc516c..7ac2b2e 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -2261,12 +2261,12 @@  static int nf_tables_newrule(struct net *net, struct sock *nlsk,
 			err = -ENOENT;
 			goto err2;
 		}
-	} else if (nlh->nlmsg_flags & NLM_F_APPEND)
+	} else if (nlh->nlmsg_flags & NLM_F_APPEND) {
 		if (old_rule)
 			list_add_rcu(&rule->list, &old_rule->list);
 		else
 			list_add_tail_rcu(&rule->list, &chain->rules);
-	else {
+	} else {
 		if (old_rule)
 			list_add_tail_rcu(&rule->list, &old_rule->list);
 		else