Commit d82f0f1fc8a4f214a50c9dfc64e3896f9894afb7
Committed by
David S. Miller
1 parent
4548a697e4
sctp: fix dst leak
Commit 0ca50d12fe46 failed to release the reference to dst entries that it decided to skip. Fixes: 0ca50d12fe46 ("sctp: fix src address selection if using secondary addresses") Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 3 additions and 1 deletions Side-by-side Diff
net/sctp/protocol.c
... | ... | @@ -511,8 +511,10 @@ |
511 | 511 | */ |
512 | 512 | odev = __ip_dev_find(sock_net(sk), laddr->a.v4.sin_addr.s_addr, |
513 | 513 | false); |
514 | - if (!odev || odev->ifindex != fl4->flowi4_oif) | |
514 | + if (!odev || odev->ifindex != fl4->flowi4_oif) { | |
515 | + dst_release(&rt->dst); | |
515 | 516 | continue; |
517 | + } | |
516 | 518 | |
517 | 519 | dst = &rt->dst; |
518 | 520 | break; |