|
@@ -539,7 +539,7 @@ int fib_encap_match(struct net *net, u16 encap_type,
|
|
{
|
|
{
|
|
struct lwtunnel_state *lwtstate;
|
|
struct lwtunnel_state *lwtstate;
|
|
struct net_device *dev = NULL;
|
|
struct net_device *dev = NULL;
|
|
- int ret;
|
|
|
|
|
|
+ int ret, result = 0;
|
|
|
|
|
|
if (encap_type == LWTUNNEL_ENCAP_NONE)
|
|
if (encap_type == LWTUNNEL_ENCAP_NONE)
|
|
return 0;
|
|
return 0;
|
|
@@ -548,10 +548,12 @@ int fib_encap_match(struct net *net, u16 encap_type,
|
|
dev = __dev_get_by_index(net, oif);
|
|
dev = __dev_get_by_index(net, oif);
|
|
ret = lwtunnel_build_state(dev, encap_type,
|
|
ret = lwtunnel_build_state(dev, encap_type,
|
|
encap, &lwtstate);
|
|
encap, &lwtstate);
|
|
- if (!ret)
|
|
|
|
- return lwtunnel_cmp_encap(lwtstate, nh->nh_lwtstate);
|
|
|
|
|
|
+ if (!ret) {
|
|
|
|
+ result = lwtunnel_cmp_encap(lwtstate, nh->nh_lwtstate);
|
|
|
|
+ lwtstate_free(lwtstate);
|
|
|
|
+ }
|
|
|
|
|
|
- return 0;
|
|
|
|
|
|
+ return result;
|
|
}
|
|
}
|
|
|
|
|
|
int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
|
|
int fib_nh_match(struct fib_config *cfg, struct fib_info *fi)
|