]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ipv4: use IS_ENABLED instead of ifdef
authorFlorian Klink <flokli@flokli.de>
Sun, 15 Nov 2020 22:45:09 +0000 (23:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 2 Dec 2020 07:49:44 +0000 (08:49 +0100)
commitee791835b3ec78178ca4c592368fa26d48dea5fa
treec320425060790d64f35837a1436a2511d8be1ef4
parent9d16996369fd9fdcd2f53963c0bd76bafd45cc2d
ipv4: use IS_ENABLED instead of ifdef

commit c09c8a27b9baa417864b9adc3228b10ae5eeec93 upstream.

Checking for ifdef CONFIG_x fails if CONFIG_x=m.

Use IS_ENABLED instead, which is true for both built-ins and modules.

Otherwise, a
> ip -4 route add 1.2.3.4/32 via inet6 fe80::2 dev eth1
fails with the message "Error: IPv6 support not enabled in kernel." if
CONFIG_IPV6 is `m`.

In the spirit of b8127113d01e53adba15b41aefd37b90ed83d631.

Fixes: d15662682db2 ("ipv4: Allow ipv6 gateway with ipv4 routes")
Cc: Kim Phillips <kim.phillips@arm.com>
Signed-off-by: Florian Klink <flokli@flokli.de>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20201115224509.2020651-1-flokli@flokli.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/fib_frontend.c