Commit 8373c6c8 authored by David Ahern's avatar David Ahern Committed by David S. Miller

ipv4: Define fib_get_nhs when CONFIG_IP_ROUTE_MULTIPATH is disabled

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
in fib_create_info.
Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
Reviewed-by: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 113e59d0
...@@ -601,6 +601,15 @@ static void fib_rebalance(struct fib_info *fi) ...@@ -601,6 +601,15 @@ static void fib_rebalance(struct fib_info *fi)
} }
#else /* CONFIG_IP_ROUTE_MULTIPATH */ #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) #define fib_rebalance(fi) do { } while (0)
#endif /* CONFIG_IP_ROUTE_MULTIPATH */ #endif /* CONFIG_IP_ROUTE_MULTIPATH */
...@@ -1102,7 +1111,6 @@ struct fib_info *fib_create_info(struct fib_config *cfg, ...@@ -1102,7 +1111,6 @@ struct fib_info *fib_create_info(struct fib_config *cfg,
} endfor_nexthops(fi) } endfor_nexthops(fi)
if (cfg->fc_mp) { if (cfg->fc_mp) {
#ifdef CONFIG_IP_ROUTE_MULTIPATH
err = fib_get_nhs(fi, cfg->fc_mp, cfg->fc_mp_len, cfg, extack); err = fib_get_nhs(fi, cfg->fc_mp, cfg->fc_mp_len, cfg, extack);
if (err != 0) if (err != 0)
goto failure; goto failure;
...@@ -1122,11 +1130,6 @@ struct fib_info *fib_create_info(struct fib_config *cfg, ...@@ -1122,11 +1130,6 @@ struct fib_info *fib_create_info(struct fib_config *cfg,
"Nexthop class id does not match RTA_FLOW"); "Nexthop class id does not match RTA_FLOW");
goto err_inval; goto err_inval;
} }
#endif
#else
NL_SET_ERR_MSG(extack,
"Multipath support not enabled in kernel");
goto err_inval;
#endif #endif
} else { } else {
struct fib_nh *nh = fi->fib_nh; struct fib_nh *nh = fi->fib_nh;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment