On 5/18/20 8:14 PM, Roopa Prabhu wrote:

> diff --git a/net/core/neighbour.c b/net/core/neighbour.c
> index b607ea6..37e4dba 100644
> --- a/net/core/neighbour.c
> +++ b/net/core/neighbour.c
> @@ -1771,6 +1771,7 @@ static struct neigh_table *neigh_find_table(int family)
>  }
>  
>  const struct nla_policy nda_policy[NDA_MAX+1] = {
> +     [NDA_UNSPEC]            = { .strict_start_type = NDA_NH_ID },
>       [NDA_DST]               = { .type = NLA_BINARY, .len = MAX_ADDR_LEN },
>       [NDA_LLADDR]            = { .type = NLA_BINARY, .len = MAX_ADDR_LEN },
>       [NDA_CACHEINFO]         = { .len = sizeof(struct nda_cacheinfo) },
> @@ -1781,6 +1782,7 @@ const struct nla_policy nda_policy[NDA_MAX+1] = {
>       [NDA_IFINDEX]           = { .type = NLA_U32 },
>       [NDA_MASTER]            = { .type = NLA_U32 },
>       [NDA_PROTOCOL]          = { .type = NLA_U8 },
> +     [NDA_NH_ID]             = { .type = NLA_U32 },

I think you also need a checks where nda_policy is used to detect if
NDA_NH_ID is set. Since the neighbor code ignores the attribute it
should send back an error if set.

Otherwise looks ok to me.

Reviewed-by: David Ahern <dsah...@gmail.com>

Reply via email to