From 13be37662d7e05c2e950ff849cb3745f14632925 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 16 Nov 2020 13:02:48 +0100 Subject: [PATCH] kernel config: explicitly enable CONFIG_IPV6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We currently build CONFIG_IPV6=m. This seems to be not really well-supported in mainline kernels - see https://lore.kernel.org/netdev/20201115224509.2020651-1-flokli@flokli.de/T/#u Compiling it as a module doesn't give too much benefit - even for people who did explicitly set `enableIPv6` to false, the `ipv6` module was still loaded, as soon as another module was loaded that requires it (bridge,br_netfilter,wireguard,ip6table_mangle,sctp,…). By compiling it in, we only loose the possibility to not add it to `boot.kernelModules` anymore (as it's part of the kernel directly). The space savings are negligible. People wanting to disable IPv6 still get the appropriate sysctls and options set (while having the kernel code loaded), nothing is really changing here. --- nixos/modules/tasks/network-interfaces.nix | 1 - pkgs/os-specific/linux/kernel/common-config.nix | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index e5bd57753683..53c54c2e3980 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -1062,7 +1062,6 @@ in ]; boot.kernelModules = [ ] - ++ optional cfg.enableIPv6 "ipv6" ++ optional hasVirtuals "tun" ++ optional hasSits "sit" ++ optional hasBonds "bonding"; diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix index 8bd5d0212044..94558b890de1 100644 --- a/pkgs/os-specific/linux/kernel/common-config.nix +++ b/pkgs/os-specific/linux/kernel/common-config.nix @@ -132,6 +132,7 @@ let IP_MROUTE_MULTIPLE_TABLES = yes; IP_MULTICAST = yes; IP_MULTIPLE_TABLES = yes; + IPV6 = yes; IPV6_ROUTER_PREF = yes; IPV6_ROUTE_INFO = yes; IPV6_OPTIMISTIC_DAD = yes;