From mboxrd@z Thu Jan 1 00:00:00 1970 From: dsahern@kernel.org Subject: [PATCH RFC net-next 05/18] net/ipv4: Define fib_get_nhs when CONFIG_IP_ROUTE_MULTIPATH is disabled Date: Fri, 31 Aug 2018 17:49:40 -0700 Message-ID: <20180901004954.7145-6-dsahern@kernel.org> References: <20180901004954.7145-1-dsahern@kernel.org> Cc: roopa@cumulusnetworks.com, sharpd@cumulusnetworks.com, idosch@mellanox.com, davem@davemloft.net, David Ahern To: netdev@vger.kernel.org Return-path: Received: from mail.kernel.org ([198.145.29.99]:36800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727261AbeIAFUT (ORCPT ); Sat, 1 Sep 2018 01:20:19 -0400 In-Reply-To: <20180901004954.7145-1-dsahern@kernel.org> Sender: netdev-owner@vger.kernel.org List-ID: From: David Ahern Define fib_get_nhs to return EINVAL when CONFIG_IP_ROUTE_MULTIPATH is not enabled and remove the ifdef check for CONFIG_IP_ROUTE_MULTIPATH. Signed-off-by: David Ahern --- net/ipv4/fib_semantics.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c index 9f8126debba5..9b2d8ba6bdb3 100644 --- a/net/ipv4/fib_semantics.c +++ b/net/ipv4/fib_semantics.c @@ -603,6 +603,15 @@ static void fib_rebalance(struct fib_info *fi) } #else /* CONFIG_IP_ROUTE_MULTIPATH */ +static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh, + int remaining, struct fib_config *cfg, + struct netlink_ext_ack *extack) +{ + NL_SET_ERR_MSG(extack, "Multipath support not enabled in kernel"); + + return -EINVAL; +} + #define fib_rebalance(fi) do { } while (0) #endif /* CONFIG_IP_ROUTE_MULTIPATH */ @@ -1112,7 +1121,6 @@ struct fib_info *fib_create_info(struct fib_config *cfg, goto failure; if (cfg->fc_mp) { -#ifdef CONFIG_IP_ROUTE_MULTIPATH err = fib_get_nhs(fi, cfg->fc_mp, cfg->fc_mp_len, cfg, extack); if (err != 0) goto failure; @@ -1133,11 +1141,6 @@ struct fib_info *fib_create_info(struct fib_config *cfg, goto err_inval; } #endif -#else - NL_SET_ERR_MSG(extack, - "Multipath support not enabled in kernel"); - goto err_inval; -#endif } else { struct fib_nh *nh = fi->fib_nh; -- 2.11.0