Re: [PATCH net] net: sched: set xt_tgchk_param par.nft_compat with false in ipt_init_target

2017-08-07 Thread Xin Long
On Tue, Aug 8, 2017 at 9:03 AM, Cong Wang  wrote:
> On Sat, Aug 5, 2017 at 4:32 AM, Xin Long  wrote:
>> Commit 55917a21d0cc ("netfilter: x_tables: add context to know if
>> extension runs from nft_compat") introduced a member nft_compat to
>> xt_tgchk_param structure.
>>
>> But it didn't set it's value for ipt_init_target. With unexpected
>> value in par.nft_compat, it may return unexpected result in some
>> target's checkentry.
>>
>> This patch is to set par.nft_compat with false in ipt_init_target.
>
> It's time to set all these fields to 0 and only initialize those non-zero
> fields, in case we will add more fields in the future.
ok, the new fix is depend on the net_id one.
I will post v2 after that one gets accepted. thanks.


Re: [PATCH net] net: sched: set xt_tgchk_param par.nft_compat with false in ipt_init_target

2017-08-07 Thread Cong Wang
On Sat, Aug 5, 2017 at 4:32 AM, Xin Long  wrote:
> Commit 55917a21d0cc ("netfilter: x_tables: add context to know if
> extension runs from nft_compat") introduced a member nft_compat to
> xt_tgchk_param structure.
>
> But it didn't set it's value for ipt_init_target. With unexpected
> value in par.nft_compat, it may return unexpected result in some
> target's checkentry.
>
> This patch is to set par.nft_compat with false in ipt_init_target.

It's time to set all these fields to 0 and only initialize those non-zero
fields, in case we will add more fields in the future.


[PATCH net] net: sched: set xt_tgchk_param par.nft_compat with false in ipt_init_target

2017-08-05 Thread Xin Long
Commit 55917a21d0cc ("netfilter: x_tables: add context to know if
extension runs from nft_compat") introduced a member nft_compat to
xt_tgchk_param structure.

But it didn't set it's value for ipt_init_target. With unexpected
value in par.nft_compat, it may return unexpected result in some
target's checkentry.

This patch is to set par.nft_compat with false in ipt_init_target.

Fixes: 55917a21d0cc ("netfilter: x_tables: add context to know if extension 
runs from nft_compat")
Signed-off-by: Xin Long 
---
 net/sched/act_ipt.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c
index bb06d2ed..7c4816b 100644
--- a/net/sched/act_ipt.c
+++ b/net/sched/act_ipt.c
@@ -56,6 +56,7 @@ static int ipt_init_target(struct net *net, struct 
xt_entry_target *t,
par.targinfo  = t->data;
par.hook_mask = hook;
par.family= NFPROTO_IPV4;
+   par.nft_compat = false;
 
ret = xt_check_target(&par, t->u.target_size - sizeof(*t), 0, false);
if (ret < 0) {
-- 
2.1.0