|
@@ -40,6 +40,7 @@
|
|
#include <linux/bitops.h>
|
|
#include <linux/bitops.h>
|
|
#include <linux/in6.h>
|
|
#include <linux/in6.h>
|
|
#include <linux/notifier.h>
|
|
#include <linux/notifier.h>
|
|
|
|
+#include <linux/inetdevice.h>
|
|
#include <net/netevent.h>
|
|
#include <net/netevent.h>
|
|
#include <net/neighbour.h>
|
|
#include <net/neighbour.h>
|
|
#include <net/arp.h>
|
|
#include <net/arp.h>
|
|
@@ -1548,6 +1549,7 @@ static int mlxsw_sp_nexthop_init(struct mlxsw_sp *mlxsw_sp,
|
|
struct fib_nh *fib_nh)
|
|
struct fib_nh *fib_nh)
|
|
{
|
|
{
|
|
struct net_device *dev = fib_nh->nh_dev;
|
|
struct net_device *dev = fib_nh->nh_dev;
|
|
|
|
+ struct in_device *in_dev;
|
|
struct mlxsw_sp_rif *r;
|
|
struct mlxsw_sp_rif *r;
|
|
int err;
|
|
int err;
|
|
|
|
|
|
@@ -1557,6 +1559,11 @@ static int mlxsw_sp_nexthop_init(struct mlxsw_sp *mlxsw_sp,
|
|
if (err)
|
|
if (err)
|
|
return err;
|
|
return err;
|
|
|
|
|
|
|
|
+ in_dev = __in_dev_get_rtnl(dev);
|
|
|
|
+ if (in_dev && IN_DEV_IGNORE_ROUTES_WITH_LINKDOWN(in_dev) &&
|
|
|
|
+ fib_nh->nh_flags & RTNH_F_LINKDOWN)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
r = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev);
|
|
r = mlxsw_sp_rif_find_by_dev(mlxsw_sp, dev);
|
|
if (!r)
|
|
if (!r)
|
|
return 0;
|
|
return 0;
|
|
@@ -1660,8 +1667,10 @@ mlxsw_sp_nexthop_group_create(struct mlxsw_sp *mlxsw_sp, struct fib_info *fi)
|
|
|
|
|
|
err_nexthop_group_insert:
|
|
err_nexthop_group_insert:
|
|
err_nexthop_init:
|
|
err_nexthop_init:
|
|
- for (i--; i >= 0; i--)
|
|
|
|
|
|
+ for (i--; i >= 0; i--) {
|
|
|
|
+ nh = &nh_grp->nexthops[i];
|
|
mlxsw_sp_nexthop_fini(mlxsw_sp, nh);
|
|
mlxsw_sp_nexthop_fini(mlxsw_sp, nh);
|
|
|
|
+ }
|
|
kfree(nh_grp);
|
|
kfree(nh_grp);
|
|
return ERR_PTR(err);
|
|
return ERR_PTR(err);
|
|
}
|
|
}
|