Thread View: linux.kernel.netdev
3 messages
3 total messages
Started by Gabriel Goller
Mon, 23 Nov 2026 15:10
[PATCH net-next v2] vxlan: always report local address
Author: Gabriel Goller
Date: Mon, 23 Nov 2026 15:10
Date: Mon, 23 Nov 2026 15:10
61 lines
9656 bytes
9656 bytes
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>
Re: [PATCH net-next v2] vxlan: always report local address
Author: Hangbin Liu
Date: Tue, 24 Nov 2026 06:47
Date: Tue, 24 Nov 2026 06:47
66 lines
10764 bytes
10764 bytes
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>
Re: [PATCH net-next v2] vxlan: always report local address
Author: patchwork-bot+netdevbpf
Date: Sun, 29 Nov 2026 16:30
Date: Sun, 29 Nov 2026 16:30
27 lines
8797 bytes
8797 bytes
Hello:
This patch was applied to netdev/net-next.git (main)
by Willem de Bruijn <willemb@google.com>:
On Mon, 23 Nov 2026 16:10:06 +0100 you 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.
>
> [...]
Here is the summary with links:
- [net-next,v2] vxlan: always report local address
https://git.kernel.org/netdev/net-next/c/7a3382d909ec
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads