Skip to content

Commit

Permalink
sctp: fix dst leak
Browse files Browse the repository at this point in the history
Commit 0ca50d1 failed to release the reference to dst entries that
it decided to skip.

Fixes: 0ca50d1 ("sctp: fix src address selection if using secondary addresses")
Signed-off-by: Marcelo Ricardo Leitner <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
marceloleitner authored and davem330 committed Sep 3, 2015
1 parent 4548a69 commit d82f0f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/sctp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,10 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
*/
odev = __ip_dev_find(sock_net(sk), laddr->a.v4.sin_addr.s_addr,
false);
if (!odev || odev->ifindex != fl4->flowi4_oif)
if (!odev || odev->ifindex != fl4->flowi4_oif) {
dst_release(&rt->dst);
continue;
}

dst = &rt->dst;
break;
Expand Down

0 comments on commit d82f0f1

Please sign in to comment.