From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796387224; b=lPYfXKL3xUztAXKIpq5ULtD3PMimqvxsnQ4E56vYuOQ3n8ww0XXzjzizFHVOmzlnqBj9 R6FxX9Qs2x88z7nGQL2alRngyrG7ngcJUix84xflzKD+XSkCTaNmM4CNG7gsIGcPf2cj2 QzoR+Hc27lzYoCkqWH5s2yMcgSDsPjZL9pFeVqAU3yr67S3u3fQruKd4RreGXxxwXd7wd x1tSGXcrZinUTpJO+iMBOdV+pBLE7N8n0jcl8E0JdYZegJUe3BIXMMOEkaGZ10zTdLPX/ O+psncFpzfYWGdtJluygbYBdqxBr8Ntj3izI/EFv6oJ2ohrDMdZsA91H2HyFIJ3MaJg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387224; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=I7PopMU4ThqDaCatSG7l05bio3XPtRzPEdHED8OKUA8=; b=EFvH5SOKisM0QSsdQe9aeWJQR9KCXZrrcVB8SPK2dwSWmSpL9xzSGyQYiMzu/gMmPAZp mWOzxJTlqPdPREqPnM9Rnzr7mz/NTPkDeqA07dIeLK4Bra9N1O4ZZZqBy5ILl7gxL/qMp Hr509giNAgYixlAzSlH/Lmkf5zijPwIz1lCh7wZfi459ExS7Sg7NSZahpoXGhK/H3bt+a Ml7EtD0Yv1jDKmPP8sn9+x8JlMH1UBy2s5QMriJrY20l8J7d7Jgi5pp/JSjdlmW+oDve4 CO4l1Tk0jYyorn1ONKEkiHfIRG0NA4Kbky41WfLYeJU47a9W4o4v/govJ3HydW7D0iw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FWWkGpqI; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76CA5606A322; Fri, 4 Dec 2026 12:27:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=FWWkGpqI Received: by smtp.kernel.org (Postfix) with ESMTPSA id E64DD1F000C2; Fri, 4 Dec 2026 12:27:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387224; bh=I7PopMU4ThqDaCatSG7l05bio3XPtRzPEdHED8OKUA8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=FWWkGpqIyx6CJnqfjbJiwgdAcmvzSZufx1b31p2j1CVBEij4SaY1odbyJU7h4kJWs tzKzk/cz/PiWOsBx13ruou949P0QP1oXEGxt+hFEHtOmAIhxMCHiycfQ7378GAogfX CzFRNu5sdi0puo1t59oGc7842vKR9DWyOEZv6Cuw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Abaci Robot , Jiapeng Chong , Simon Horman , David Ahern , Jakub Kicinski , Sasha Levin Subject: [PATCH 6.1 0156/1059] ipv6: ICMPV6: Use swap() instead of open coding it Date: Fri, 4 Dec 2026 18:54:47 +0900 Message-ID: <20261204100648.259980595@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jiapeng Chong [ Upstream commit bc61761394ce0f0cc35c6fc60426f08d83d0d488 ] Swap is a function interface that provides exchange function. To avoid code duplication, we can use swap function. ./net/ipv6/icmp.c:344:25-26: WARNING opportunity for swap(). Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=3896 Signed-off-by: Jiapeng Chong Reviewed-by: Simon Horman Reviewed-by: David Ahern Link: https://lore.kernel.org/r/20230131063456.76302-1-jiapeng.chong@linux.alibaba.com Signed-off-by: Jakub Kicinski Stable-dep-of: 30c71476d842 ("ipv6: Check the Home Address option again before its address is used") Signed-off-by: Sasha Levin --- net/ipv6/icmp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/net/ipv6/icmp.c b/net/ipv6/icmp.c index e984f03b0b418..63fbc69cf0faf 100644 --- a/net/ipv6/icmp.c +++ b/net/ipv6/icmp.c @@ -336,7 +336,6 @@ static void mip6_addr_swap(struct sk_buff *skb, const struct inet6_skb_parm *opt { struct ipv6hdr *iph = ipv6_hdr(skb); struct ipv6_destopt_hao *hao; - struct in6_addr tmp; int off; if (opt->dsthao) { @@ -344,9 +343,7 @@ static void mip6_addr_swap(struct sk_buff *skb, const struct inet6_skb_parm *opt if (likely(off >= 0)) { hao = (struct ipv6_destopt_hao *) (skb_network_header(skb) + off); - tmp = iph->saddr; - iph->saddr = hao->addr; - hao->addr = tmp; + swap(iph->saddr, hao->addr); } } } -- 2.53.0