From: Hangbin Liu <hangbin.liu@linux.dev>
To: Gabriel Goller <g.goller@proxmox.com>
Cc: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Ido Schimmel <idosch@nvidia.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v2] vxlan: always report local address
Date: Tue, 24 Nov 2026 14:47:44 +0800 [thread overview]
Message-ID: <20261124064744.GC14932@Liu-laptop> (raw)
In-Reply-To: <20261123-vxlan_preserve_local-v2-1-72d89179a98d@proxmox.com>
On Mon, Nov 23, 2026 at 04:10:06PM +0100, Gabriel Goller wrote:
> When a VXLAN device has no local address, link dumps and notifications
> contain neither IFLA_VXLAN_LOCAL nor IFLA_VXLAN_LOCAL6. If the device
> also has no remote or group address, userspace can't tell whether it is
> an IPv4 or IPv6 device, even though the kernel stores the family. FRR
> runs into this when it finds existing VXLAN devices after a restart.
>
> Report the local address even when it is unset, as IFLA_VXLAN_LOCAL
> 0.0.0.0 or IFLA_VXLAN_LOCAL6 ::, so the attribute type shows the
> family.
>
> Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
> ---
> Changes in v2:
> - rebase
> - Link to v1: https://lore.kernel.org/20261104-vxlan_preserve_local-v1-1-e9b51f2132b4@proxmox.com
> ---
> drivers/net/vxlan/vxlan_core.c | 19 +++++++++----------
> 1 file changed, 9 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
> index d11028b37472..b7ad60cb5d12 100644
> --- a/drivers/net/vxlan/vxlan_core.c
> +++ b/drivers/net/vxlan/vxlan_core.c
> @@ -4765,18 +4765,17 @@ static int vxlan_fill_info(struct sk_buff *skb, const struct net_device *dev)
> if (cfg->remote_ifindex && nla_put_u32(skb, IFLA_VXLAN_LINK, cfg->remote_ifindex))
> goto nla_put_failure;
>
> - if (!vxlan_addr_any(&cfg->saddr)) {
> - if (cfg->saddr.sa.sa_family == AF_INET) {
> - if (nla_put_in_addr(skb, IFLA_VXLAN_LOCAL,
> - cfg->saddr.sin.sin_addr.s_addr))
> - goto nla_put_failure;
> + /* Report the address family even when the local address is unspecified. */
> + if (cfg->saddr.sa.sa_family == AF_INET) {
> + if (nla_put_in_addr(skb, IFLA_VXLAN_LOCAL,
> + cfg->saddr.sin.sin_addr.s_addr))
> + goto nla_put_failure;
> #if IS_ENABLED(CONFIG_IPV6)
> - } else {
> - if (nla_put_in6_addr(skb, IFLA_VXLAN_LOCAL6,
> - &cfg->saddr.sin6.sin6_addr))
> - goto nla_put_failure;
> + } else {
> + if (nla_put_in6_addr(skb, IFLA_VXLAN_LOCAL6,
> + &cfg->saddr.sin6.sin6_addr))
> + goto nla_put_failure;
> #endif
> - }
> }
>
> if (nla_put_u8(skb, IFLA_VXLAN_TTL, cfg->ttl) ||
>
> ---
> base-commit: 2388bb763e323442f4dd8189238ac0c5f334c4a0
> base-tree: git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git main
> change-id: 20261104-vxlan_preserve_local-c3fa959e9715
>
> Best regards,
> --
> Gabriel Goller <g.goller@proxmox.com>
>
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
next prev parent reply other threads:[~2026-11-24 6:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 15:10 [PATCH net-next v2] vxlan: always report local address Gabriel Goller
2026-11-24 6:47 ` Hangbin Liu [this message]
2026-11-29 16:30 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261124064744.GC14932@Liu-laptop \
--to=hangbin.liu@linux.dev \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=g.goller@proxmox.com \
--cc=idosch@nvidia.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.