|
@@ -326,8 +326,10 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
|
|
final_p = fl6_update_dst(fl6, rcu_dereference(np->opt), &final);
|
|
final_p = fl6_update_dst(fl6, rcu_dereference(np->opt), &final);
|
|
bdst = ip6_dst_lookup_flow(sk, fl6, final_p);
|
|
bdst = ip6_dst_lookup_flow(sk, fl6, final_p);
|
|
|
|
|
|
- if (!IS_ERR(bdst) &&
|
|
|
|
- ipv6_chk_addr(dev_net(bdst->dev),
|
|
|
|
|
|
+ if (IS_ERR(bdst))
|
|
|
|
+ continue;
|
|
|
|
+
|
|
|
|
+ if (ipv6_chk_addr(dev_net(bdst->dev),
|
|
&laddr->a.v6.sin6_addr, bdst->dev, 1)) {
|
|
&laddr->a.v6.sin6_addr, bdst->dev, 1)) {
|
|
if (!IS_ERR_OR_NULL(dst))
|
|
if (!IS_ERR_OR_NULL(dst))
|
|
dst_release(dst);
|
|
dst_release(dst);
|
|
@@ -336,8 +338,10 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
|
|
}
|
|
}
|
|
|
|
|
|
bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
|
|
bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
|
|
- if (matchlen > bmatchlen)
|
|
|
|
|
|
+ if (matchlen > bmatchlen) {
|
|
|
|
+ dst_release(bdst);
|
|
continue;
|
|
continue;
|
|
|
|
+ }
|
|
|
|
|
|
if (!IS_ERR_OR_NULL(dst))
|
|
if (!IS_ERR_OR_NULL(dst))
|
|
dst_release(dst);
|
|
dst_release(dst);
|