static const struct nla_policy rtm_nh_policy_get[] = {
[NHA_ID] = { .type = NLA_U32 },
+ [NHA_OP_FLAGS] = NLA_POLICY_MASK(NLA_U32, 0),
};
static const struct nla_policy rtm_nh_policy_del[] = {
[NHA_GROUPS] = { .type = NLA_FLAG },
[NHA_MASTER] = { .type = NLA_U32 },
[NHA_FDB] = { .type = NLA_FLAG },
+ [NHA_OP_FLAGS] = NLA_POLICY_MASK(NLA_U32, 0),
};
static const struct nla_policy rtm_nh_res_policy_new[] = {
}
static int nh_valid_get_del_req(const struct nlmsghdr *nlh,
- struct nlattr **tb, u32 *id,
+ struct nlattr **tb, u32 *id, u32 *op_flags,
struct netlink_ext_ack *extack)
{
struct nhmsg *nhm = nlmsg_data(nlh);
return -EINVAL;
}
+ if (tb[NHA_OP_FLAGS])
+ *op_flags = nla_get_u32(tb[NHA_OP_FLAGS]);
+ else
+ *op_flags = 0;
+
return 0;
}
.portid = NETLINK_CB(skb).portid,
};
struct nexthop *nh;
+ u32 op_flags;
int err;
u32 id;
if (err < 0)
return err;
- err = nh_valid_get_del_req(nlh, tb, &id, extack);
+ err = nh_valid_get_del_req(nlh, tb, &id, &op_flags, extack);
if (err)
return err;
struct nlattr *tb[NHA_MAX + 1];
struct sk_buff *skb = NULL;
struct nexthop *nh;
+ u32 op_flags;
int err;
u32 id;
if (err < 0)
return err;
- err = nh_valid_get_del_req(nlh, tb, &id, extack);
+ err = nh_valid_get_del_req(nlh, tb, &id, &op_flags, extack);
if (err)
return err;
bool group_filter;
bool fdb_filter;
u32 res_bucket_nh_id;
+ u32 op_flags;
};
static bool nh_dump_filtered(struct nexthop *nh,
return -EINVAL;
}
+ if (tb[NHA_OP_FLAGS])
+ filter->op_flags = nla_get_u32(tb[NHA_OP_FLAGS]);
+ else
+ filter->op_flags = 0;
+
return 0;
}
struct netlink_ext_ack *extack)
{
struct nlattr *tb[NHA_MAX + 1];
+ u32 op_flags;
int err;
err = nlmsg_parse(nlh, sizeof(struct nhmsg), tb, NHA_MAX,
if (err < 0)
return err;
- err = nh_valid_get_del_req(nlh, tb, id, extack);
+ err = nh_valid_get_del_req(nlh, tb, id, &op_flags, extack);
if (err)
return err;