Re: [PATCH net-next v4 2/4] net: vxlan: add netlink option to bind vxlan sockets to local addresses

From: Ido Schimmel
Date: Sun Jul 20 2025 - 10:10:35 EST


On Thu, Jul 17, 2025 at 01:54:10PM +0200, Richard Gobert wrote:
> diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
> index bcde95cb2a2e..667ff17c4569 100644
> --- a/drivers/net/vxlan/vxlan_core.c
> +++ b/drivers/net/vxlan/vxlan_core.c
> @@ -3406,6 +3406,7 @@ static const struct nla_policy vxlan_policy[IFLA_VXLAN_MAX + 1] = {
> [IFLA_VXLAN_LABEL_POLICY] = NLA_POLICY_MAX(NLA_U32, VXLAN_LABEL_MAX),
> [IFLA_VXLAN_RESERVED_BITS] = NLA_POLICY_EXACT_LEN(sizeof(struct vxlanhdr)),
> [IFLA_VXLAN_MC_ROUTE] = NLA_POLICY_MAX(NLA_U8, 1),
> + [IFLA_VXLAN_LOCALBIND] = { .type = NLA_U8 },

NLA_POLICY_MAX(NLA_U8, 1) is more future proof in the unlikely case that
we would want to assign different meanings to values greater than 1.

> };