To enable compiling the network stack without IPv4, IPv4 specific packet rerouting logic inside netfilter must be bypassed. Therefore, guard ip_route_me_harder() with IS_ENABLED(CONFIG_IPV4) so it returns -EPROTONOSUPPORT when IPv4 is disabled. Signed-off-by: Fernando Fernandez Mancera --- net/ipv4/netfilter.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c index ce9e1bfa4259..f2d9e0110b77 100644 --- a/net/ipv4/netfilter.c +++ b/net/ipv4/netfilter.c @@ -30,6 +30,9 @@ int ip_route_me_harder(struct net *net, struct sock *sk, struct sk_buff *skb, un struct flow_keys flkeys; unsigned int hh_len; + if (!IS_ENABLED(CONFIG_IPV4)) + return -EPROTONOSUPPORT; + sk = sk_to_full_sk(sk); flags = sk ? inet_sk_flowi_flags(sk) : 0; -- 2.56.1