* [PATCH net-next] net: remove the unnecessary strict_start_type in some policies
@ 2019-11-21 10:08 Xin Long
2019-11-21 18:51 ` Jakub Kicinski
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Xin Long @ 2019-11-21 10:08 UTC (permalink / raw)
To: network dev; +Cc: davem, simon.horman, jakub.kicinski
ct_policy and mpls_policy are parsed with nla_parse_nested(), which
does NL_VALIDATE_STRICT validation, strict_start_type is not needed
to set as it is actually trying to make some attributes parsed with
NL_VALIDATE_STRICT.
This patch is to remove it, and do the same on rtm_nh_policy which
is parsed by nlmsg_parse().
Suggested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
---
net/ipv4/nexthop.c | 1 -
net/sched/act_ct.c | 1 -
net/sched/act_mpls.c | 1 -
3 files changed, 3 deletions(-)
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c
index fc34fd1..511eaa9 100644
--- a/net/ipv4/nexthop.c
+++ b/net/ipv4/nexthop.c
@@ -23,7 +23,6 @@ static void remove_nexthop(struct net *net, struct nexthop *nh,
#define NH_DEV_HASHSIZE (1U << NH_DEV_HASHBITS)
static const struct nla_policy rtm_nh_policy[NHA_MAX + 1] = {
- [NHA_UNSPEC] = { .strict_start_type = NHA_UNSPEC + 1 },
[NHA_ID] = { .type = NLA_U32 },
[NHA_GROUP] = { .type = NLA_BINARY },
[NHA_GROUP_TYPE] = { .type = NLA_U16 },
diff --git a/net/sched/act_ct.c b/net/sched/act_ct.c
index 68d6af5..c13638ae 100644
--- a/net/sched/act_ct.c
+++ b/net/sched/act_ct.c
@@ -474,7 +474,6 @@ static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
}
static const struct nla_policy ct_policy[TCA_CT_MAX + 1] = {
- [TCA_CT_UNSPEC] = { .strict_start_type = TCA_CT_UNSPEC + 1 },
[TCA_CT_ACTION] = { .type = NLA_U16 },
[TCA_CT_PARMS] = { .type = NLA_EXACT_LEN, .len = sizeof(struct tc_ct) },
[TCA_CT_ZONE] = { .type = NLA_U16 },
diff --git a/net/sched/act_mpls.c b/net/sched/act_mpls.c
index 4d8c822..c7d5e12 100644
--- a/net/sched/act_mpls.c
+++ b/net/sched/act_mpls.c
@@ -119,7 +119,6 @@ static int valid_label(const struct nlattr *attr,
}
static const struct nla_policy mpls_policy[TCA_MPLS_MAX + 1] = {
- [TCA_MPLS_UNSPEC] = { .strict_start_type = TCA_MPLS_UNSPEC + 1 },
[TCA_MPLS_PARMS] = NLA_POLICY_EXACT_LEN(sizeof(struct tc_mpls)),
[TCA_MPLS_PROTO] = { .type = NLA_U16 },
[TCA_MPLS_LABEL] = NLA_POLICY_VALIDATE_FN(NLA_U32, valid_label),
--
2.1.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: remove the unnecessary strict_start_type in some policies
2019-11-21 10:08 [PATCH net-next] net: remove the unnecessary strict_start_type in some policies Xin Long
@ 2019-11-21 18:51 ` Jakub Kicinski
2019-11-21 19:46 ` David Miller
2019-11-21 19:47 ` David Ahern
2 siblings, 0 replies; 4+ messages in thread
From: Jakub Kicinski @ 2019-11-21 18:51 UTC (permalink / raw)
To: Xin Long; +Cc: network dev, davem, simon.horman, dsahern@gmail.com
On Thu, 21 Nov 2019 18:08:38 +0800, Xin Long wrote:
> ct_policy and mpls_policy are parsed with nla_parse_nested(), which
> does NL_VALIDATE_STRICT validation, strict_start_type is not needed
> to set as it is actually trying to make some attributes parsed with
> NL_VALIDATE_STRICT.
>
> This patch is to remove it, and do the same on rtm_nh_policy which
> is parsed by nlmsg_parse().
>
> Suggested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: remove the unnecessary strict_start_type in some policies
2019-11-21 10:08 [PATCH net-next] net: remove the unnecessary strict_start_type in some policies Xin Long
2019-11-21 18:51 ` Jakub Kicinski
@ 2019-11-21 19:46 ` David Miller
2019-11-21 19:47 ` David Ahern
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-11-21 19:46 UTC (permalink / raw)
To: lucien.xin; +Cc: netdev, simon.horman, jakub.kicinski
From: Xin Long <lucien.xin@gmail.com>
Date: Thu, 21 Nov 2019 18:08:38 +0800
> ct_policy and mpls_policy are parsed with nla_parse_nested(), which
> does NL_VALIDATE_STRICT validation, strict_start_type is not needed
> to set as it is actually trying to make some attributes parsed with
> NL_VALIDATE_STRICT.
>
> This patch is to remove it, and do the same on rtm_nh_policy which
> is parsed by nlmsg_parse().
>
> Suggested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
Applied.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: remove the unnecessary strict_start_type in some policies
2019-11-21 10:08 [PATCH net-next] net: remove the unnecessary strict_start_type in some policies Xin Long
2019-11-21 18:51 ` Jakub Kicinski
2019-11-21 19:46 ` David Miller
@ 2019-11-21 19:47 ` David Ahern
2 siblings, 0 replies; 4+ messages in thread
From: David Ahern @ 2019-11-21 19:47 UTC (permalink / raw)
To: Xin Long, network dev; +Cc: davem, simon.horman, jakub.kicinski
On 11/21/19 3:08 AM, Xin Long wrote:
> ct_policy and mpls_policy are parsed with nla_parse_nested(), which
> does NL_VALIDATE_STRICT validation, strict_start_type is not needed
> to set as it is actually trying to make some attributes parsed with
> NL_VALIDATE_STRICT.
>
> This patch is to remove it, and do the same on rtm_nh_policy which
> is parsed by nlmsg_parse().
>
> Suggested-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Signed-off-by: Xin Long <lucien.xin@gmail.com>
> ---
> net/ipv4/nexthop.c | 1 -
> net/sched/act_ct.c | 1 -
> net/sched/act_mpls.c | 1 -
> 3 files changed, 3 deletions(-)
>
>
Reviewed-by: David Ahern <dsahern@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-21 19:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-21 10:08 [PATCH net-next] net: remove the unnecessary strict_start_type in some policies Xin Long
2019-11-21 18:51 ` Jakub Kicinski
2019-11-21 19:46 ` David Miller
2019-11-21 19:47 ` David Ahern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).