diff options
author | Xin Long <lucien.xin@gmail.com> | 2019-01-22 02:42:41 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-01-24 18:13:57 -0800 |
commit | ecf938fe7d0088077ee1280419a2b3c5429b47c8 (patch) | |
tree | d95b6f275d7266f8b9cfd890dfe1d2072c905ef8 /net/nsh | |
parent | 4ff40b86262b73553ee47cc3784ce8ba0f220bd8 (diff) | |
download | linux-stable-ecf938fe7d0088077ee1280419a2b3c5429b47c8.tar.gz linux-stable-ecf938fe7d0088077ee1280419a2b3c5429b47c8.tar.bz2 linux-stable-ecf938fe7d0088077ee1280419a2b3c5429b47c8.zip |
sctp: set flow sport from saddr only when it's 0
Now sctp_transport_pmtu() passes transport->saddr into .get_dst() to set
flow sport from 'saddr'. However, transport->saddr is set only when
transport->dst exists in sctp_transport_route().
If sctp_transport_pmtu() is called without transport->saddr set, like
when transport->dst doesn't exists, the flow sport will be set to 0
from transport->saddr, which will cause a wrong route to be got.
Commit 6e91b578bf3f ("sctp: re-use sctp_transport_pmtu in
sctp_transport_route") made the issue be triggered more easily
since sctp_transport_pmtu() would be called in sctp_transport_route()
after that.
In gerneral, fl4->fl4_sport should always be set to
htons(asoc->base.bind_addr.port), unless transport->asoc doesn't exist
in sctp_v4/6_get_dst(), which is the case:
sctp_ootb_pkt_new() ->
sctp_transport_route()
For that, we can simply handle it by setting flow sport from saddr only
when it's 0 in sctp_v4/6_get_dst().
Fixes: 6e91b578bf3f ("sctp: re-use sctp_transport_pmtu in sctp_transport_route")
Reported-by: Ying Xu <yinxu@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/nsh')
0 files changed, 0 insertions, 0 deletions