CONFIG_NF_NAT_IPV4 and CONFIG_NF_NAT_IPV6 were merged into CONFIG_NF_NAT on:
CONFIG_NF_NAT_MASQUERADE_IPV4 and CONFIG_NF_NAT_MASQUERADE_IPV6 were merged into CONFIG_NF_NAT_MASQUERADE on:
Proposed fix: https://github.com/gentoo/gentoo/pull/12559
So robbat2 already tweaked this wihtout going through maintainer. Maybe he has some thoughts on how to handle it in a way that keeps it working for both old and new kernels.
@leio: My fix predates this bug being filed, but the original date was lost in rebasing, so it only looks like it's older than this bug.
(In reply to Mart Raudsepp from comment #2)
> So robbat2 already tweaked this wihtout going through maintainer. Maybe he
> has some thoughts on how to handle it in a way that keeps it working for
> both old and new kernels.
What's wrong with Rodrigo's suggestion that clearly checks the kernel version?
The options I set, NF_NAT & NF_NAT_MASQUERADE are NOT new options in v5.1. They already existed. The only change is that NAT_IPV/NF_NAT_MASQUERADE_IPV don't exist anymore as of v5.1.
Even in older kernels, you have to go really out of your way to get a config where NF_NAT=n because of the logic around NETFILTER_ADVANCED and IP_NF_NAT.
> config IP_NF_NAT
> depends on NF_CONNTRACK
> default m if NETFILTER_ADVANCED=n
> select NF_NAT
> select NF_NAT_IPV4
> select NETFILTER_XT_NAT
The sole risk would be a user building a NEW stable system, and setting NF_NAT=y && NAT_IPV6=n; and getting a configuration that passed the checks as I updated them, but not the connection-sharing functionality not work.
So it would be worth adding the version checks as Rodrigo had done to ensure 4.x kernel users find the option from their kernel configurator (menuconfig, etc) of choice?