Skip to content

Commit

Permalink
Merge branch 'sctp-fixes'
Browse files Browse the repository at this point in the history
Marcelo Ricardo Leitner says:

====================
couple of sctp fixes for 0ca50d1

These are two fixes for sctp after my patch on 0ca50d1 ("sctp: fix
src address selection if using secondary addresses")

The first, fix a dst leak on those it decided to skip.

The second, adds the fallback on src selection that Vlad had asked
about. Unfortunatelly a lot of ipvs setups relies on the old behavior
and I don't see a better fix for it.

Please consider both to -stable tree.
====================

Acked-by: Neil Horman <nhorman@tuxdriver.com>
Acked-by: Vlad Yasevich <vyasevich@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Sep 3, 2015
2 parents 4548a69 + 410f038 commit 724a763
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion net/sctp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,22 @@ static void sctp_v4_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
if (IS_ERR(rt))
continue;

if (!dst)
dst = &rt->dst;

/* Ensure the src address belongs to the output
* interface.
*/
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) {
if (&rt->dst != dst)
dst_release(&rt->dst);
continue;
}

if (dst != &rt->dst)
dst_release(dst);
dst = &rt->dst;
break;
}
Expand Down

0 comments on commit 724a763

Please sign in to comment.