Article View: linux.kernel.netdev
Article #14002[PATCH net v2] vxlan: reset the remote's dst cache when snooping moves a MAC
From: CMGS
Date: Tue, 10 Nov 2026 15:30
Date: Tue, 10 Nov 2026 15:30
66 lines
13571 bytes
13571 bytes
vxlan_snoop() handles a known MAC that now arrives from another remote
by rewriting the remote's IP address in place. It leaves the remote's
dst_cache alone, so the next packet to that MAC is routed with the dst
cached for the previous remote. When the two remotes have different
next hops, the packet leaves the wrong way. For example, if the
previous remote was on-link and the new one is behind a router, the
device resolves the new remote's address on the local link, the
neighbour stays incomplete, and traffic to the MAC is blackholed until
the cached route is invalidated, such as by "ip route flush cache".
The same branch also leaves remote_ifindex unchanged, although the
early return compares it and vxlan_xmit_one() uses it as the output
interface. When a MAC moves between an IPv6 link-local and another
address, the remote keeps the previous interface, and every later
packet from that remote enters the migration branch again.
vxlan_fdb_replace(), which makes the same change through netlink,
already resets the cache, updates remote_ifindex and clears offloaded.
Do the same when snooping.
Reproduced with network namespaces: a learning VXLAN device has one
peer VTEP on-link and another behind a router, and an inner MAC moves
from the first peer to the second. Without this patch, pings to the MAC
fail after the move until the route cache is flushed: in 10 of 10 runs
with one CPU, and in 5 of 6 runs with two CPUs, where it depends on
whether the sending CPU holds the stale entry. With the patch, they
succeed in all 16 runs. In a second setup over IPv6, the MAC moves from
a peer with a global address to a peer with a link-local one. Without
this patch, the move and every later packet from the new peer each send
an RTM_NEWNEIGH notification, 33 in each run. With the patch, only the
move sends one.
This was found by our AI-driven automated live migration tests. The fix
and this changelog were written with the help of an AI coding assistant.
Fixes: 0c1d70af924b ("net: use dst_cache for vxlan device")
Fixes: 87613de95041 ("vxlan: fix snooping for link-local IPv6 addresses")
Signed-off-by: CMGS <ilskdw@gmail.com>
---
v2:
- also update remote_ifindex and clear offloaded, as vxlan_fdb_replace() does
- add the IPv6 link-local case to the changelog and a second Fixes tag
v1: https://lore.kernel.org/netdev/20261106144406.66035-1-ilskdw@gmail.com/
drivers/net/vxlan/vxlan_core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/vxlan/vxlan_core.c b/drivers/net/vxlan/vxlan_core.c
index d11028b37..6bc54642e 100644
--- a/drivers/net/vxlan/vxlan_core.c
+++ b/drivers/net/vxlan/vxlan_core.c
@@ -1482,7 +1482,10 @@ static enum skb_drop_reason vxlan_snoop(struct net_device *dev,
"%pM migrated from %pIS to %pIS\n",
src_mac, &rdst->remote_ip.sa, &src_ip->sa);
+ dst_cache_reset(&rdst->dst_cache);
rdst->remote_ip = *src_ip;
+ rdst->remote_ifindex = ifindex;
+ rdst->offloaded = false;
vxlan_fdb_notify(vxlan, f, rdst, RTM_NEWNEIGH, true, NULL);
} else {
/* learned new entry */
--
2.47.3
Technical Details
Message-ID:
<20261110153020.9635-1-ilskdw@gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360387-linux-kernel-netdev=dewy.ruShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360387-linux-kernel-netdev=dewy.ru
From: ilskdw@gmail.com (CMGS)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net v2] vxlan: reset the remote's dst cache when snooping moves a MAC
Date: Tue, 10 Nov 2026 23:30:20 +0800
Organization: Usenet Network
Message-ID: <20261110153020.9635-1-ilskdw@gmail.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
logging-data="641270"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:r0K6kQm0ye7Jl4CNzhOCxDAk7GI= sha256:r4IMUWWkn7GraTIe/RgMFbXeBaSx6EsbyRn/hYN9CdQ=
sha1:Q3haTFaNm6H0kE5nevfJis1CVrI= sha256:/WwI5zQDEaV8EWltkH3B4gVM6Ob2w7CXS5U0UUhD60w=
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 159A3113C2C; Tue, 10 Nov 2026 18:47:14 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.049
X-Spam-Status: No, score=-3.049 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=gmail.com
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 Ad91o5Iuh7G3;
Tue, 10 Nov 2026 18:47:10 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-360387-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
by mail.dewy.ru (Postfix) with ESMTPS id 1F136113C29; Tue, 10 Nov 2026 18:47:02 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by tor.lore.kernel.org (Postfix) with ESMTP id 3BA871870F6; Tue, 10 Nov 2026 15:30:56 +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=1794324630;
b=gM+6zAI3jU03XzQgvYuTXAw6QJEO1Oo0enS4mnIUecx86/IBe3iiRcHVGObHFbknHrp9
FliEOw4deRYuhqVe3/RadBQgTJpycW3X92yevndNBrC/rHTVhE95LImg793BzTpa6EMhD
cfCPjiplHllCY7PbRhRef7va27YRi9yzf48QN36Y7pIHvSikReqsJ86MJSGHfd8cKtMrc
tRbXcGNNm2mgKPm0Wkbg6yByNi2T6GXgrqffbCrPqSgIGwsybNb9Z6jWtKe1YAL0Z0tBT
58ZjYzGI4OrWFOYnCiu7AMdMAINAGN16iKL0hEHA9BSOXAGjexgK5bl2ZSqaHBCasQA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794324630;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
Received:From:To:Cc:Subject:Date:Message-ID:X-Mailer:X-Mailing-List:
List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
List-Owner:Precedence:MIME-Version:Content-Transfer-Encoding;
bh=ptI5TWXLUlJ/nEd1Y9XUGbt6UYgT2k24kx/bLOwYN3k=;
b=PfxOAe9FrsVdUa2CFXF4gUjImXZv5sRtuiKsyxhTIwbBmKpmLGweniX2YoFrEVJobRT8
7NtGfESuCB6aNYTXqfke2wfFzm/ACPJVPhp2z2sdmxdGdPrHiyzIXPBLlsAPLJnb5+5kK
y+Sa5flMA8YKihGT0wlbXcMpDN+o7ArcLOlLptIPwpT31Y5QlPCPERmoi/sHr1vifH46u
X4XlsIdmAx4ovTh22yuKLB2765ouvZIc9TaQVPczP2urxLmBh2NcTJqzf68zaPKqCIw3F
EgP+Ex9YwfM79fw2QWQNXkYoJsQW1XsAaYhqsD61zEG47TCLe69PX3D1Afc1y3oyZeg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="cb+ac/gv";
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
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 A650660A2601;
Tue, 10 Nov 2026 15:30:30 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=cb+ac/gv
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.174
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1794324629;
b=uiddoXYgD2/RRAjLIciybqzRBkAx8k8cneBlu8pWIas0T142QYfGj2GwGkXEAsPb/1Y2
j9TOq5l2PKnYD8D7fLYjatqg1JQVX3oO+riNsxHHm8F6ZiLLtUiIeDGDynj+JGsh3+uOl
MzWMs7+7emS+FAvb/QqHoU7QJZyC+ZGqiK0dbMDdZSFFpyCeVIziO780a7aNOZwgUdWqp
5Q7aE9jn4smPdkSDaUkstr6jbSWCAsjaB3ZTePVtyYhuDxOAZ8oUhEr7ziAISXvnboRJc
tIj3bahez1Pg+J3p+elw+y52eY73dVfji8wFqZQgygQ/+0g5sndpA8GUDPqdl7b4/OA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1794324629;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Gm-Message-State:X-Gm-Gg:X-Received:Received:From:To:Cc:Subject:
Date:Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding;
bh=ptI5TWXLUlJ/nEd1Y9XUGbt6UYgT2k24kx/bLOwYN3k=;
b=KBmLHamEB5HO6ZNoKn8ouHoHKj8yAqwZzQZTTVnzYPQ4tv47JYdmTl78i8kFo+TvtwZy
RbPdjVKUAE1AzeT4/JFU4KzAcep/Fom/Tlr+JMkjISXePF3FGmdrCI/BnCoP1eOuvnr/6
GJQkRA8H2uP6UgdoFJlxyUlAWZg2uGGITeiGd+wbg1ndHkO60OPuaRFa7P/nxeHOKPw8q
++/EoHgCZCIlzybfbyWcUNe2TkgsP64N5axYeP8JM9RYIIvgNRleEe/npPG4dWgRYQBKz
0R4rtNBLT135GqS4W5Y+UR5ZR7YX801WOAh5oJ3WLQ5B9msGD0X5xZjYydW2ZrpGbsA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=gmail.com;
spf=pass smtp.mailfrom=gmail.com;
dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="cb+ac/gv";
arc=none smtp.remote-ip=74.125.82.174
X-Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174])
(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 71BF8606A320
for <netdev@vger.kernel.org>; Tue, 10 Nov 2026 15:30:29 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 71BF8606A320
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-36eb1cb7aabso3337648eec.0
for <netdev@vger.kernel.org>; Tue, 10 Nov 2026 07:30:29 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20260707; t=1794324628; x=1794929428; darn=vger.kernel.org;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:from:to:cc:subject:date:message-id:reply-to:content-type;
bh=ptI5TWXLUlJ/nEd1Y9XUGbt6UYgT2k24kx/bLOwYN3k=;
b=cb+ac/gvsg4CPZoDILmlj5uWqnXKk7TA+9F5PXoZj9wLF+PaIBavoGJnw285jIo4/j
iWRqa6jXCJq+RDlaLnTBzhGai+FNThCx6bQ/S4xdQpVA3z+xYBEKDCXTEsCJ8RtnInBz
2BVhz/NEHGYVMUWHFL36BW1chRTCKpbGdadR7oAFowP5jAbR2NJnS1brvGzmBxKc63os
ayXcvAWOouCAaK9SqXqSGUxBeZzapD9vHX4xzJj3gQlLjjGtYR68AUJfCxiyFVfbGwpG
IsNhpNbNhi8gmiZNXGPsHRDw0bohJI49uoHmxJ0iCX/t8VUnYrRZGcDXknbob1nqjYEM
xUig==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1794324628; x=1794929428;
h=content-transfer-encoding:mime-version:message-id:date:subject:cc
:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date
:message-id:reply-to:content-type;
bh=ptI5TWXLUlJ/nEd1Y9XUGbt6UYgT2k24kx/bLOwYN3k=;
b=PDb25SH5Wmkeav3tr3P5C/0Tq2GcW4Z4VJAK/O8YeNVOAPxWypmQl3q6npolRqq+1y
p/mf4+r52upXyn/AEayglvmyyIdXP1twcPEyn6DQ2l8oU1P+Uv9XREOUWV7Tc8oGpwXd
XsNlaeddDQhB1LJsbvrPRbft6M39rgOSIzjAyMLn1JPFt35l7oDSUWZwL0qpGufG5u1G
bdO+xbsn6WcCcJSVIWn4CGMX7ZFWHxFwRfJOa+b86Fw2+cBi/ehL9pxhBv8p4cqf49i7
WlGkj5DZoLNSZeqXxZ1yqwxgeO3f6BgGLA6mLEziSzAQ//yGl8lXRl8aowrhSQH4kgnC
2XLA==
X-Gm-Message-State: APuU4Z92OP4Xedg126crHgXs50K2EGwP0RvS5qAwZinbpHytAeMguoBx
j/gJi9ufYAjMmWPjLLYnrFsinv/7Zu1EHEz5mXADZtRkCkO9haRY4RjSwNJI6Ii6
X-Gm-Gg: AYBFou1go6jNV7NXuuT6UNiadubxhTmpaUcOg4ZG7NkmbibQC3L8tSVSXQl1b6ZRI/n
Qfq3qohZPqW2+dQTxY0EX2OgD2QONCXFkv8xxeP2IHhK37mn3n9RHhiUpLl0n/r1jiESrSffgy7
S+HStFscYDQadEJ3gLYDl18zvIe6s19fNp75mYtI0tkyHnkQt+MLaPFEubarOcZIG4DfCtnk7+e
5waKeksMw9lBhqmX+sGmroim4BQJ7SpCZ9bYzzyU7xMQMZOaquOxrZQAVtS8GIr69KqvOxj5UN9
2/5DCZUFIuN3q0JfDWI3LiWI6NhDVmO+NRs037CuCEIrtoulayAsBJzIAG6jRHEasXOFXyUyhtP
Q5OckaH4WD6E+KjFcBAFxTtH3tcdk2TI7hVapsz1Kqg/d4Jc6hIIBTHSMp7tf9wQmZMvDfho7WH
eUZXTy85jhRW5Pkw09w2olqUj8lwPS2Ch7/p/GxrluxpMPz2iL+km+pW7ML7f1sluaQgQXe3RAi
3EdOS3AA7YtT5ypPhMrfxvOTOi35SVsm2wJhAMNioRYP/GGP647/+KmAbJOjgHpAlioPwQogPDg
R8SgRu+u1CohBAvVoe2rO5pUF8YoMa4DQmkA4JEHVL6M+jp6csHfZwH31M4qjkkspZ7x92F0RXp
n4hQ=
X-Received: by 2002:a05:7300:a498:b0:36f:5746:3364 with SMTP id 5a478bee46e88-37520bf7048mr4607740eec.28.1794324628231;
Tue, 10 Nov 2026 07:30:28 -0800 (PST)
X-Received: from localhost.localdomain ([116.88.205.165])
by smtp.gmail.com with ESMTPSA id 5a478bee46e88-375218c863csm7476355eec.28.2026.11.10.07.30.23
(version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
Tue, 10 Nov 2026 07:30:25 -0800 (PST)
X-Cc: andrew+netdev@lunn.ch,
davem@davemloft.net,
edumazet@kernel.org,
kuba@kernel.org,
pabeni@redhat.com,
kuniyu@google.com,
mschiffer@universe-factory.net
X-Mailer: git-send-email 2.54.0
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