Article View: linux.kernel.netdev
Article #16960Re: [PATCH net 1/2] ioam6: drop the packet if no outer source address is available
From: Hangbin Liu
Date: Mon, 16 Nov 2026 05:47
Date: Mon, 16 Nov 2026 05:47
43 lines
9664 bytes
9664 bytes
On Sun, Nov 15, 2026 at 01:00:46AM +0100, Justin Iurman wrote:
> When no tunnel source is configured, ioam6_do_encap() ignores the
> return value of ipv6_dev_get_saddr(). On failure, the outer header
> keeps the source address copied from the inner header, so the packet
> is sent with an address that may not belong to this node.
>
> Drop the packet instead.
>
> Fixes: 8cb3bf8bff3c ("ipv6: ioam: Add support for the ip6ip6 encapsulation")
> Signed-off-by: Justin Iurman <justin.iurman@gmail.com>
> ---
> net/ipv6/ioam6_iptunnel.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/net/ipv6/ioam6_iptunnel.c b/net/ipv6/ioam6_iptunnel.c
> index cfb2c41634a0..4990ae1ee78c 100644
> --- a/net/ipv6/ioam6_iptunnel.c
> +++ b/net/ipv6/ioam6_iptunnel.c
> @@ -324,11 +324,14 @@ static int ioam6_do_encap(struct net *net, struct sk_buff *skb,
> hdr->payload_len = cpu_to_be16(skb->len - sizeof(*hdr));
> hdr->daddr = *tundst;
>
> - if (has_tunsrc)
> + if (has_tunsrc) {
> memcpy(&hdr->saddr, tunsrc, sizeof(*tunsrc));
> - else
> - ipv6_dev_get_saddr(net, dst_dev(dst), &hdr->daddr,
> - IPV6_PREFER_SRC_PUBLIC, &hdr->saddr);
> + } else {
> + err = ipv6_dev_get_saddr(net, dst_dev(dst), &hdr->daddr,
> + IPV6_PREFER_SRC_PUBLIC, &hdr->saddr);
> + if (unlikely(err))
> + return err;
> + }
>
> skb_postpush_rcsum(skb, hdr, len);
>
> --
> 2.34.1
>
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Technical Details
Message-ID:
<avqYw4zlIvpnKMNo@fedora>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364073-linux-kernel-netdev=dewy.ruReferences:
<20261115000047.14669-1-justin.iurman@gmail.com> <20261115000047.14669-2-justin.iurman@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-364073-linux-kernel-netdev=dewy.ru From: hangbin.liu@linux.dev (Hangbin Liu) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 1/2] ioam6: drop the packet if no outer source address is available Date: Mon, 16 Nov 2026 13:47:09 +0800 Organization: Usenet Network Message-ID: <avqYw4zlIvpnKMNo@fedora> References: <20261115000047.14669-1-justin.iurman@gmail.com> <20261115000047.14669-2-justin.iurman@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1989802"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:vV1GMaN5xqiK0qBbZaUiHHh3/Eg= sha256:DuLZ59EupDQ8xiHXvuJnb3sG+p6/qr7rW8HXlG4dcl0= sha1:9Df79R9nlklmpOOO4IFlHV0cXa4= sha256:2MhxZpd/00hK9MCRLxbZlJREOFzGNwDtZtAelr5tIhQ= 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 C1E76114B35; Mon, 16 Nov 2026 08:47:41 +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 E9q4yH03YQ68; Mon, 16 Nov 2026 08:47:35 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-364073-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 49417114B17; Mon, 16 Nov 2026 08:47:26 +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 A088230712; Mon, 16 Nov 2026 05:47:21 +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=1794808041; b=DA04ZVvE8YJ0xfeanlRgJPMrwMMfz7B0sDIpenSLS0QgWpalrUfPzoInsVs1HZw9RHhI 7hjwz5TW94XFEuOxIPQBccOvviF4K62ph442ca1QlTnCqtTRtcLqfUcHC7rI2s88/Jq7R +yWkuVDY1JtjWnizJdpzarHdrJz0wRbv3S8cC/QRvnghfbHu+4jXz37F9t3Hn4FCoHsZ7 kdZYny/somm5ltYXkHWBR0sNpRgDhX5Fk9z0urs8juUN+nRWxU9oq4x1nlcH4srnDUyVQ 4AcwXZeJM9uFRTLYVlI/EOIAEYxLlCzxiooQ3BVaXONkAhWQ6PXqtxinrPqq4tHxKaw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794808041; 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=gdvAspZggwJA276q0FHn0pkQ7VN/3rpACkNhZPI+9fo=; b=k2aNBBxkE0UY31frT6YIg/SJ+HQ0vMXPXTd+JB5K554woJZXA97fz2VfaR8M6S5m77nY TrAhsqVXj6ZhZTJ1nHfbhZB4oJG3q6RIrZQOd4+IC5nLjDwIedxdWp2wzGLEL5dZgqcry Pz262ViEWvFYu30vrQu19nv2hrPWFGroJ0d+eZaSmolNX1Jro1Mve0Pu0iwRMgqfhQDeS drZ//Ms2ZL5FdFPpxNr/J2goNIwd+Jd9sB5q67wcJGZDRl++lNjI7iUXtG1cHwcc3K5RF k/A3GtHHBFnsGKbgSbEYMEEgeGpp3VClGdtzcd79sl2x3hcF9+Cj1hhRL9ZW5lcLhrQ== 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=lMHJujFe; 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 21737606A330; Mon, 16 Nov 2026 05:47:21 +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=lMHJujFe X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.231 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794808040; b=jfXm/5xWB+PhKl5l+RgSAg93sqHURh+KhMF1NIPF6bajQnlYomDodysPH/DVS/3PKwvg bi60odoN25xSTvshDctdugT+zrzHt2MGnZrGKqbJHNRLTyRN4PFRBfkQ3APgxdIdIwLkp JUX4dvQlMrf1zOXnWmn0z3g3oSRAAP24rwbd16IO2ypYp+Q5VAtaOTZn75cdYKu9TkoQ+ RY6QLQc0HXuPvghZNzHK2u/C+2nU2g16BR3vq/aMxO2pnIw2wcygEWFTe+Tb65RXixvev lms8rCa2z5Wn1EdEuAs9m8ZoQ1LgY1yi87t6s5ILc2dF8T5UWuJWhp+4R3Vh4TQWPCA== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794808040; 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=gdvAspZggwJA276q0FHn0pkQ7VN/3rpACkNhZPI+9fo=; b=PKCFkm0sEDqLSLHH6Z6atIx6mC1FvNjOybrWIpWghedQS11e3Mo2xmyDF4FR/wx6Yrfy oKxezhL6KiHzNI/zuBCL6EZzBUYMvsiCG1tZkgQ7hLZG3pOZLxjLdjJbibtKUxa65Ms5u ZBCuJScMqgriRJKXhFqak8C1tGHmkaWQDXmeb7b89wHI60oY154WJCLBVLpkWJd5J6dzh LFzUN+4L6QdnHJanEGJhRjlilLWrSL0xkG2BY4dmtTyWIZ85JWhZILH+IgIZD0/Z7cTm9 bDXFlGN1ysIC4uAUhsuBYvc72B8/HEcZlADhkBcRHyYvQtZtpR0B7mhWK8sIMeDUIWw== 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=lMHJujFe; arc=none smtp.remote-ip=91.218.175.231 X-Received: from mta0.migadu.com (out-231.mta0.migadu.com [91.218.175.231]) (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 8DA57606A31C for <netdev@vger.kernel.org>; Mon, 16 Nov 2026 05:47:19 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8DA57606A31C 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=UQOsUJzIqjEeGyyOxOZX8x3rD9PH23RKiC6Lv6Uz/rE=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1794808037; v=1; x=1795412837; b=lMHJujFetMmatZAvjvRId9Toz0ZGyIQfBGZmZ+9EGsPvbTM165gKXG8ZGLk2SXkKlkfr/5e6 GvV55I56NpjWLpmLZ1rLyBwf/+v1DggO8K7OYHB9uxjzlEcMaAHldZ9gsDSsSdvzuL+wvpwxI+1 1M5yXJtb9Ext+GzF3EzSWEH8= X-Envelope-To: netdev@vger.kernel.org X-Received: by mta12.migadu.com with ESMTPS id 7377c0c34a4c72f3; Mon, 16 Nov 2026 05:47:17 +0000 X-Mizu-Trace-ID: 7377c0c34a4c72f3 X-Migadu-Flow: FLOW_OUT X-Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, andrea.mayer@uniroma2.it 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: <20261115000047.14669-2-justin.iurman@gmail.com>