[PATCH 2/6] net: Add CONFIG_LEGACY_IP option

David Woodhouse posted 6 patches 14 hours ago
[PATCH 2/6] net: Add CONFIG_LEGACY_IP option
Posted by David Woodhouse 14 hours ago
From: David Woodhouse <dwmw@amazon.co.uk>

Add a new CONFIG_LEGACY_IP boolean option under CONFIG_INET that will
gate Legacy IP functionality. When disabled, the kernel will not
register the AF_INET socket family, IPv4 packet handler, ARP, or IPv4
routing, while the shared TCP/UDP/INET socket infrastructure remains
available for IPv6.

This is the first step toward making Legacy IP optional. The option
defaults to y and currently has no effect — subsequent patches will use
it to guard IPv4 entry points.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
---
 net/ipv4/Kconfig | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
index df922f9f5289..aef2c5349e62 100644
--- a/net/ipv4/Kconfig
+++ b/net/ipv4/Kconfig
@@ -2,6 +2,17 @@
 #
 # IP configuration
 #
+config LEGACY_IP
+	bool "The IPv4 protocol (Legacy IP)"
+	help
+	  Support for IP version 4 (IPv4).
+
+	  Legacy IP is the protocol used by the early ARPANET, before IPv6
+	  was standardised in the final decade of the 1900s. It should only
+	  be necessary these days to interoperate with legacy networks.
+
+	  If unsure, say N.
+
 config IP_MULTICAST
 	bool "IP: multicasting"
 	help
-- 
2.51.0

Re: [PATCH 2/6] net: Add CONFIG_LEGACY_IP option
Posted by bot+bpf-ci@kernel.org 13 hours ago
> This is the first step toward making Legacy IP optional. The option
> defaults to y and currently has no effect — subsequent patches will use
> it to guard IPv4 entry points.

The commit message says "The option defaults to y", but the Kconfig
entry has no "default y" line.  A bool without an explicit default
is n in Kconfig, so LEGACY_IP will be disabled on any fresh config
built with make defconfig or make olddefconfig.

Later patches in this series (be2f051150f9, f04a0717c27d) add
"depends on LEGACY_IP" to all IPv4-specific Kconfig symbols and guard
IPv4 entry points in C code.  With LEGACY_IP defaulting to n, those
patches will silently disable IPv4 networking for any newly generated
kernel configuration.

Should the Kconfig entry include "default y" to match the stated
intent?

> diff --git a/net/ipv4/Kconfig b/net/ipv4/Kconfig
> index df922f9f5289..aef2c5349e62 100644
> --- a/net/ipv4/Kconfig
> +++ b/net/ipv4/Kconfig
> @@ -2,6 +2,17 @@
>  #
>  # IP configuration
>  #
> +config LEGACY_IP
> +	bool "The IPv4 protocol (Legacy IP)"
> +	help
> +	  Support for IP version 4 (IPv4).
> +
> +	  Legacy IP is the protocol used by the early ARPANET, before IPv6
> +	  was standardised in the final decade of the 1900s. It should only
> +	  be necessary these days to interoperate with legacy networks.
> +
> +	  If unsure, say N.

The help text says "If unsure, say N."  Combined with the missing
default, this guides users to disable IPv4.  If the intent is a
backward-compatible introduction where IPv4 stays enabled unless
explicitly turned off, this should probably be "If unsure, say Y."


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/23838411859