diff options
author | David S. Miller <davem@davemloft.net> | 2015-09-04 01:43:06 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-09-04 01:43:06 +0300 |
commit | 724a7636ad026a3a68f3fc626ccd04111f65cfd9 (patch) | |
tree | e9cc4151a252deba27e10e2ff06a2bd437a80b07 /net | |
parent | 4548a697e4969d695047cebd6d9af5e2f6cc728e (diff) | |
parent | 410f03831c0768f2b1850d28ba697b167ddcb89b (diff) | |
download | linux-724a7636ad026a3a68f3fc626ccd04111f65cfd9.tar.xz |
Merge branch 'sctp-fixes'
Marcelo Ricardo Leitner says:
====================
couple of sctp fixes for 0ca50d12fe46
These are two fixes for sctp after my patch on 0ca50d12fe46 ("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>
Diffstat (limited to 'net')
-rw-r--r-- | net/sctp/protocol.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index 4345790ad326..b7143337e4fa 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c @@ -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; } |