🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #23685

[PATCH net-next v4 10/16] tunnels: guard IPv4 tunnel functions with CONFIG_IPV4

#23685
From: Fernando Fernandez Mancera
Date: Fri, 27 Nov 2026 17:17
40 lines
9757 bytes
To enable compiling INET subsystem withou IPv4, IPv4 specific IP tunnel
core functions must be bypassed when the protocol is disabled.

Signed-off-by: Fernando Fernandez Mancera <fmancera@suse.de>
---
 net/ipv4/ip_tunnel_core.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index 6c2855adff28..ddb8bf44040f 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -58,6 +58,14 @@ void iptunnel_xmit(struct sock *sk, struct rtable *rt, struct sk_buff *skb,
 	struct iphdr *iph;
 	int err;
 
+	if (!IS_ENABLED(CONFIG_IPV4)) {
+		if (dev)
+			DEV_STATS_INC(dev, tx_errors);
+		ip_rt_put(rt);
+		kfree_skb(skb);
+		return;
+	}
+
 	if (unlikely(dev_recursion_level() > IP_TUNNEL_RECURSION_LIMIT)) {
 		if (dev) {
 			net_crit_ratelimited("Dead loop on virtual device %s (net %llu), fix it urgently!\n",
@@ -226,6 +234,9 @@ static int iptunnel_pmtud_build_icmp(struct sk_buff *skb, int mtu)
 	struct ethhdr eh;
 	int len, err;
 
+	if (!IS_ENABLED(CONFIG_IPV4))
+		return -EOPNOTSUPP;
+
 	if (!pskb_may_pull(skb, ETH_HLEN + sizeof(struct iphdr)))
 		return -EINVAL;
 
-- 
2.56.1
Technical Details
Message-ID: <20261127171824.27362-11-fmancera@suse.de>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372892-linux-kernel-netdev=dewy.ru
References: <20261127171824.27362-1-fmancera@suse.de>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!3.eu.feeder.erje.net!feeder.erje.net!feeder1.feed.ams11.usenet.farm!feed.usenet.farm!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-372892-linux-kernel-netdev=dewy.ru
From: fmancera@suse.de (Fernando Fernandez Mancera)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v4 10/16] tunnels: guard IPv4 tunnel functions with CONFIG_IPV4
Date: Fri, 27 Nov 2026 18:17:55 +0100
Organization: Usenet Network
Message-ID: <20261127171824.27362-11-fmancera@suse.de>
References: <20261127171824.27362-1-fmancera@suse.de>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network; logging-data="781943"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:az2jph2XTMeQLeAQEkw/5Wt5xwo= sha256:WWG6/nAS3ZWbrhRfFyM6UHdRwsl5VOlcdhIbibZqAp8= sha1:dSWI/NW+nhv5UAal+QQojPcM+mo= sha256:L0F4Wy4rfErMNkN4vDfTtGeEhumOA7t3Pp1aTvMLvc0=
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 8160C125F63; Fri, 27 Nov 2026 20:20:25 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[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-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 nxCAKQGIGSBu; Fri, 27 Nov 2026 20:20:23 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-372892-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=suse.de
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id CA5A8125F5E; Fri, 27 Nov 2026 20:20:19 +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 995FC25B36; Fri, 27 Nov 2026 17:20:18 +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=1795800016; b=VcFzMXfrFaWLG/Y8fXjKedMq2NdKa2mdemMAwgPLaWyv8oGd7x99GTKkevPwYSdRCgGD TV7KieEKEq/ivINJNqUSGy9wCN4cTTghtDVyz4BktainoNQO74N4/WqzGhtaBaYmbA71r zh0cKR+/w3KnID4GqvluLiJo1LuGGE5cYt/ySAt+0CdjhIDLYjmso2i1VEkLWtw5Bdjnp p8orlAbEDyG7EyyPoJRwj+SONcpPgfqVZCq2NT2/2kZlkc3Ul5Y4t/FXw/kmLPXJYUWt8 gEscSQN7owuE86c6f2FJWBC8oFySSIP/V8WW1s3j4KsvTGtjb8ko5+DQrDFk24Dtr6A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795800016; h=X-Original-To:Received:DMARC-Filter:Received:Received:Received:From: To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding:X-Rspamd-Pre-Result:X-Rspamd-Queue-Id: X-Rspamd-Pre-Result:X-Rspamd-Action:X-Rspamd-Server:X-Spam-Level: X-Spamd-Result:X-Spam-Flag:X-Spam-Score; bh=+bhi6dvzg4ljP3B7TapCAgatTlJLpISmxA2j011epZk=; b=LPzIqCqnC5l1/4f7xgaOua1z8QKGVVWRo3v13hePulSAw8JuONsinvwnAbLIYH7A2pVg HUtfU+ZRASC/LrpNspZHLZXYWsgdKZGMfP0wkzitTXEXDMDrohQ9rwdV0s03vElp5GSoG D1EVj3eAzJE2ekT2sR86r3KsOPgNsNszvGb1fQDyyPjO4IBnJEJbq0iUtQBeISHXjrcz+ cGdZRsVpDzkgmLeqCGh9MwGX0qihPMsKq8nZLES2QQnzFdAKLbNYneVDFXMQGhiSB9YIt kntlpTn/UJ4bBAEWMwL5TA+/uKWD/gkMSuyvwx3XEE7/GBmcO/3o0oiNHmaSfPui03g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=suse.de; spf=pass smtp.mailfrom=suse.de; 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 102BA606A31C; Fri, 27 Nov 2026 17:20:16 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.135.223.130
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795800015; b=dVXwOUu3R29UxptVnUh0ovE+RWwPnpkjwueguCCex+6VRgAmVefHnpniHyyYa5GS/aj7 nl1cVhrGobEC0Rnwb9c7+EglOfapv/lUVUQzncyE843NILGFBHQ/SHRAbUyV2IMU6dixB FfxpcRFz0qxY3y9XGskYpFQAferiJL5Y303tETe5aqjgZ5Exgog1QgGyinzfhI+rjJ8B3 aImGQr//RKFrFVdcUJTXupF9OyDmv3rNsX5TNyQJoHT2EWnuWjDpdW5jaT1qcPhbl3tEn BLgfDo3B4Zig+jd+eT+lTCAlRjjIdL04NLOHmISNMjdKhxomAMtjJPsc4wktxcXcfkQ==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795800015; h=DMARC-Filter:Received:Received:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Rspamd-Pre-Result:X-Rspamd-Queue-Id: X-Rspamd-Pre-Result:X-Rspamd-Action:X-Rspamd-Server:X-Spam-Level: X-Spamd-Result:X-Spam-Flag:X-Spam-Score; bh=+bhi6dvzg4ljP3B7TapCAgatTlJLpISmxA2j011epZk=; b=U5psJu+AKEK1ucEiG6xki3vicEvN5DcdEHkUm/wMxvLuHkHd8MCS4IlmZXXClTjD6DyY d20G7kbhMLxQdxMIZjqrsTnZpDy4e3XOFKEV1jQlSyvLWGb71poRzgVUXFdKo9fe7mAdg J6k2L/xq95Z3Yn+Sk45XK98j72uQ9rV8EdyMgfjCDGs/szCorPbcyZh9loF/8TAW1tcur z4SfsN9UNGEGl++UAwxdLdgqCOVZrxn0i13MiRzXCiSLKpnKHFeCrLszmUjPYNAUT4JIB 8MursauHPLmIKPwLkf9NL0gXnPi068GdBfsh16CThIe5FZQJzc4XMBzhtfO3ObWEOdQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.de; spf=pass smtp.mailfrom=suse.de; arc=none smtp.remote-ip=195.135.223.130
X-Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED364606A324 for <netdev@vger.kernel.org>; Fri, 27 Nov 2026 17:20:14 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ED364606A324
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de
X-Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4742822063; Fri, 27 Nov 2026 17:20:13 +0000 (UTC)
X-Authentication-Results: smtp-out1.suse.de; none
X-Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 8C92613432; Fri, 27 Nov 2026 17:20:12 +0000 (UTC)
X-Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id /Yb1MH67CWuMAwAAD6G6ig:T11 (envelope-from <fmancera@suse.de>); Fri, 27 Nov 2026 17:20:12 +0000
X-Cc: davem@davemloft.net, kuba@kernel.org, edumazet@kernel.org, pabeni@redhat.com, horms@kernel.org, Fernando Fernandez Mancera <fmancera@suse.de>, David Ahern <dsahern@kernel.org>, Ido Schimmel <idosch@nvidia.com>, Willem de Bruijn <willemb@google.com>
X-Mailer: git-send-email 2.51.0
X-In-Reply-To: <20261127171824.27362-1-fmancera@suse.de>
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-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated
X-Rspamd-Queue-Id: 4742822063
X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated
X-Rspamd-Action: no action
X-Rspamd-Server: rspamd2.dmz-prg2.suse.org
X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[]
X-Received-Bytes: 9499