🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #21559

Re: [PATCH net-next v2] vxlan: always report local address

#21559
From: Hangbin Liu
Date: Tue, 24 Nov 2026 06:47
66 lines
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>
Technical Details
Message-ID: <20261124064744.GC14932@Liu-laptop>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370054-linux-kernel-netdev=dewy.ru
References: <20261123-vxlan_preserve_local-v2-1-72d89179a98d@proxmox.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370054-linux-kernel-netdev=dewy.ru
From: hangbin.liu@linux.dev (Hangbin Liu)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v2] vxlan: always report local address
Date: Tue, 24 Nov 2026 14:47:44 +0800
Organization: Usenet Network
Message-ID: <20261124064744.GC14932@Liu-laptop>
References: <20261123-vxlan_preserve_local-v2-1-72d89179a98d@proxmox.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="4072830"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Yb/AfkoKl1oRW2lvF/P0KzKanW8= sha256:R1x70+IgJQJNl5EmKzpg570/QZusXx2rySRclRIw+oo=
	sha1:3VVC1BYGPD7SlSJkXz7uFMcglRg= sha256:gK99G46ycyq3fhI/rASYiv+TQeizDEMJBGdMZr6VchY=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 83F65125DCE; Tue, 24 Nov 2026 09:48:23 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.05
X-Spam-Status: No, score=-3.05 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=linux.dev
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id GWwnEtkCSABl;
	Tue, 24 Nov 2026 09:48:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370054-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id D4472125DCC; Tue, 24 Nov 2026 09:48:00 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 8AF072F309; Tue, 24 Nov 2026 06:47:57 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795502876;
	b=ackfNfxtftVCLNQW1EWCpKFUQuSLmT1ALRntjTKnGiTSjt9dpzHoK2NUHwXWI2D6QHxP
	 sxa0E2kkMJ+wIgOqIZTlcdHD/WEI0xZE9kEkf80073KE8e2tgjY3Pb25LZGNAi3Rezhc3
	 LowDC0pg4t28a8jorM2nYa95OSRzobSjDvRn934yZ6Rjditq09BfnWlhKwLaVeRNRjWmj
	 lqO+xDwr+lOXG6GbfJP5Jwr6vh1yb1+XoXodUk7PBQHuk1W/owOmKRDQJFqAlReXs32tt
	 +nTdgBdZI4Tiw+ko1HTkItnV+UpZed/UdPaU38Ij7I29WqiE6TNTx9AEf6oILAzXGwg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795502876;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=gFwBodHAGBDbWf9JpGhvw7svf2pK3gtlu6FQIiMCf9Q=;
	b=Qn412MF+53Uo8OxGNfRU0xmNUa/4RDhFchhI8XG1BPFdB5q/9Erex+5dOnO808J3VCKm
	 ZJkB+43WNCMNniIYuQ9j+jEifez4+XsB/OXuuzfrcu12ybJdVMMSjBBZkzvk1sGAYJaLg
	 LpaVvPSC6fwZE7ETlBHml6zjq4yWhKrAwtcZo+b4j+Hw/url6rESPh63osgIB535XFGwO
	 0j99wLqlEdwbCfRSKvY3+dSre87W9+Gv0piAGgI8OwTHxY2FhKkWKazEFgz8Q8Gh6TC1i
	 Tfw5X4w4acW9w6vpvKuyfqsQ/QamozxTjQ/5f8A9/MPgWj6EyPvsaMeqEWLm44UuFOQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=iRQvAcou;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A56CC606A32E;
	Tue, 24 Nov 2026 06:47:56 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=iRQvAcou
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.110
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795502875;
	b=zYCzJPocJv86sVla4oQgFlsmh+LYlXkw5ML/eMHnD1ulnhe1BsQ9nN5psVPpQYlWq1Fz
	 5Qsjqh86+ZksUddChWL+UPs4xFgt5ygEWHE97fXDiCleSjNT59fukbj89AfDZjLpdygWN
	 7H9QVe77QSaDm+NSbqTGmzgAPwTGPSiBicGR8oFF9HyzouZiNEKk7NS6EfIsg/3HR0TZE
	 0V//VZ9cZEPdhi9VeRvkB9sQbwH6iLfDcYJWFzML+pHXpOo2d+AP92ezHbkRqDLeo5BBi
	 VUtTCIj+jzpgGuCS+2LM5whqonmP6PyIVQUO77aUpf3ho8fxDJeGIH1oZEtKM+FmcUA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795502875;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=gFwBodHAGBDbWf9JpGhvw7svf2pK3gtlu6FQIiMCf9Q=;
	b=nf2Vcie5SBOLL+waLQckThKa7nJv45ME1B8ypdloF0nj0/32c0tVkoJy5OYajGM+RU4c
	 1NJMok1oR2abBWHWfQAU5gIMNyMyGbNpom2upvU8TJzDs6w7wWuYmFQ4gsAzuUdTrbGjQ
	 oS9jg83BzIBCwNuQvlQ3b9B8O+LROU17UvK5zSKxGBzxudIRuRR+lL0FiWg2P72HOzEGB
	 8lEIJn3ZGffWZb8qoliIZsjVae2kzlheTAnUnIIPfN/owAajLU+vzOUsi80gK12YJCx7j
	 id7R7Z0OuCPhZxeMvrn3qJmxqWtEq1BryLZnAnWyKFN4vsvZe7ct4vxBUFIa1oJ0xcg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=iRQvAcou;
	arc=none smtp.remote-ip=91.218.175.110
X-Received: from mta0.migadu.com (out-110.mta0.migadu.com [91.218.175.110])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id F29B3606A322
	for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 06:47:54 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org F29B3606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=MCB11qv4KSVKKMEE6AuGYmXMoszO6pWe2RyhcuU+7T4=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1795502873; v=1; x=1796107673;
 b=iRQvAcoutYVwsy9Rk6m+2ohowrSVQQn+Pv3G3+wn2W8lzHpebcB5vvaAA1pfPZaSKPEdz9RR
 gPNQcVR2jMj78M0uGDUBXH+qeMU5bwpI15pO92tLde4O3OYVW2AjIeDZNHxPkn9HcUwtnmLhPCI
 D1xY+R65n0ByF/lKhJfeL5uQ=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by mta10.migadu.com with ESMTPS id ab07041aaeeca585;
	Tue, 24 Nov 2026 06:47:52 +0000
X-Mizu-Trace-ID: ab07041aaeeca585
X-Migadu-Flow: FLOW_OUT
X-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
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261123-vxlan_preserve_local-v2-1-72d89179a98d@proxmox.com>