|
@@ -511,7 +511,8 @@ static int fib_get_nhs(struct fib_info *fi, struct rtnexthop *rtnh,
|
|
dev = __dev_get_by_index(net, cfg->fc_oif);
|
|
dev = __dev_get_by_index(net, cfg->fc_oif);
|
|
ret = lwtunnel_build_state(dev, nla_get_u16(
|
|
ret = lwtunnel_build_state(dev, nla_get_u16(
|
|
nla_entype),
|
|
nla_entype),
|
|
- nla, &lwtstate);
|
|
|
|
|
|
+ nla, AF_INET, cfg,
|
|
|
|
+ &lwtstate);
|
|
if (ret)
|
|
if (ret)
|
|
goto errout;
|
|
goto errout;
|
|
nexthop_nh->nh_lwtstate =
|
|
nexthop_nh->nh_lwtstate =
|
|
@@ -535,7 +536,8 @@ errout:
|
|
|
|
|
|
static int fib_encap_match(struct net *net, u16 encap_type,
|
|
static int fib_encap_match(struct net *net, u16 encap_type,
|
|
struct nlattr *encap,
|
|
struct nlattr *encap,
|
|
- int oif, const struct fib_nh *nh)
|
|
|
|
|
|
+ int oif, const struct fib_nh *nh,
|
|
|
|
+ const struct fib_config *cfg)
|
|
{
|
|
{
|
|
struct lwtunnel_state *lwtstate;
|
|
struct lwtunnel_state *lwtstate;
|
|
struct net_device *dev = NULL;
|
|
struct net_device *dev = NULL;
|
|
@@ -546,8 +548,8 @@ static int fib_encap_match(struct net *net, u16 encap_type,
|
|
|
|
|
|
if (oif)
|
|
if (oif)
|
|
dev = __dev_get_by_index(net, oif);
|
|
dev = __dev_get_by_index(net, oif);
|
|
- ret = lwtunnel_build_state(dev, encap_type,
|
|
|
|
- encap, &lwtstate);
|
|
|
|
|
|
+ ret = lwtunnel_build_state(dev, encap_type, encap,
|
|
|
|
+ AF_INET, cfg, &lwtstate);
|
|
if (!ret) {
|
|
if (!ret) {
|
|
result = lwtunnel_cmp_encap(lwtstate, nh->nh_lwtstate);
|
|
result = lwtunnel_cmp_encap(lwtstate, nh->nh_lwtstate);
|
|
lwtstate_free(lwtstate);
|
|
lwtstate_free(lwtstate);
|
|
@@ -571,7 +573,7 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
|
|
if (cfg->fc_encap) {
|
|
if (cfg->fc_encap) {
|
|
if (fib_encap_match(net, cfg->fc_encap_type,
|
|
if (fib_encap_match(net, cfg->fc_encap_type,
|
|
cfg->fc_encap, cfg->fc_oif,
|
|
cfg->fc_encap, cfg->fc_oif,
|
|
- fi->fib_nh))
|
|
|
|
|
|
+ fi->fib_nh, cfg))
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
if ((!cfg->fc_oif || cfg->fc_oif == fi->fib_nh->nh_oif) &&
|
|
if ((!cfg->fc_oif || cfg->fc_oif == fi->fib_nh->nh_oif) &&
|
|
@@ -663,7 +665,7 @@ int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
|
|
static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
|
|
static int fib_check_nh(struct fib_config *cfg, struct fib_info *fi,
|
|
struct fib_nh *nh)
|
|
struct fib_nh *nh)
|
|
{
|
|
{
|
|
- int err;
|
|
|
|
|
|
+ int err = 0;
|
|
struct net *net;
|
|
struct net *net;
|
|
struct net_device *dev;
|
|
struct net_device *dev;
|
|
|
|
|
|
@@ -1005,7 +1007,8 @@ struct fib_info *fib_create_info(struct fib_config *cfg)
|
|
if (cfg->fc_oif)
|
|
if (cfg->fc_oif)
|
|
dev = __dev_get_by_index(net, cfg->fc_oif);
|
|
dev = __dev_get_by_index(net, cfg->fc_oif);
|
|
err = lwtunnel_build_state(dev, cfg->fc_encap_type,
|
|
err = lwtunnel_build_state(dev, cfg->fc_encap_type,
|
|
- cfg->fc_encap, &lwtstate);
|
|
|
|
|
|
+ cfg->fc_encap, AF_INET, cfg,
|
|
|
|
+ &lwtstate);
|
|
if (err)
|
|
if (err)
|
|
goto failure;
|
|
goto failure;
|
|
|
|
|