Skip to content

Commit d82f0f1

Browse files
marceloleitnerdavem330
authored andcommitted
sctp: fix dst leak
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]>
1 parent 4548a69 commit d82f0f1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

net/sctp/protocol.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,8 +511,10 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
511511
*/
512512
odev = __ip_dev_find(sock_net(sk), laddr->a.v4.sin_addr.s_addr,
513513
false);
514-
if (!odev || odev->ifindex != fl4->flowi4_oif)
514+
if (!odev || odev->ifindex != fl4->flowi4_oif) {
515+
dst_release(&rt->dst);
515516
continue;
517+
}
516518

517519
dst = &rt->dst;
518520
break;

0 commit comments

Comments
 (0)