Skip to content

Commit f3bed7f

Browse files
lxindavem330
authored andcommitted
net: remove the unnecessary strict_start_type in some policies
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 <[email protected]> Signed-off-by: Xin Long <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ff998a8 commit f3bed7f

File tree

3 files changed

+0
-3
lines changed

3 files changed

+0
-3
lines changed

net/ipv4/nexthop.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ static void remove_nexthop(struct net *net, struct nexthop *nh,
2323
#define NH_DEV_HASHSIZE (1U << NH_DEV_HASHBITS)
2424

2525
static const struct nla_policy rtm_nh_policy[NHA_MAX + 1] = {
26-
[NHA_UNSPEC] = { .strict_start_type = NHA_UNSPEC + 1 },
2726
[NHA_ID] = { .type = NLA_U32 },
2827
[NHA_GROUP] = { .type = NLA_BINARY },
2928
[NHA_GROUP_TYPE] = { .type = NLA_U16 },

net/sched/act_ct.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,6 @@ static int tcf_ct_act(struct sk_buff *skb, const struct tc_action *a,
474474
}
475475

476476
static const struct nla_policy ct_policy[TCA_CT_MAX + 1] = {
477-
[TCA_CT_UNSPEC] = { .strict_start_type = TCA_CT_UNSPEC + 1 },
478477
[TCA_CT_ACTION] = { .type = NLA_U16 },
479478
[TCA_CT_PARMS] = { .type = NLA_EXACT_LEN, .len = sizeof(struct tc_ct) },
480479
[TCA_CT_ZONE] = { .type = NLA_U16 },

net/sched/act_mpls.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ static int valid_label(const struct nlattr *attr,
119119
}
120120

121121
static const struct nla_policy mpls_policy[TCA_MPLS_MAX + 1] = {
122-
[TCA_MPLS_UNSPEC] = { .strict_start_type = TCA_MPLS_UNSPEC + 1 },
123122
[TCA_MPLS_PARMS] = NLA_POLICY_EXACT_LEN(sizeof(struct tc_mpls)),
124123
[TCA_MPLS_PROTO] = { .type = NLA_U16 },
125124
[TCA_MPLS_LABEL] = NLA_POLICY_VALIDATE_FN(NLA_U32, valid_label),

0 commit comments

Comments
 (0)