sctp: do not send packet to response OOTB packet if no route
Subsystems (2)
PATCH 1/1 sctp: do not send packet to response OOTB packet if no route
When we send a response packet to the OOTB packet, first we try to get the route with both the OOTB packet's src and dest address, this may return no route in some case, such as we had set the outbound sctp packet should be discarded by IPsec. Then when we really to transmit the response packet, we will only use the OOTB packet's src address to lookup a route, this will alaways fail or get an alert address which is not the OOTB packet's dest address. So we should not try to send the response packet if there is no route at the first setp.
Signed-off-by Wei Yongjun <[email protected]>
--- net/sctp/sm_statefuns.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-)
net/sctp/sm_statefuns.c +6 -0
@@ -5835,6 +5835,12 @@ static struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asocsctp_transport_route (transport, (union sctp_addr *)&chunk->dest,sctp_sk (sctp_get_ctl_sock ())); +/* No router for this OOTB packet */ +if (!transport->dst) { +kfree (transport); + goto nomem; + } + packet =sctp_packet_init (&transport->packet, transport, sport, dport); packet =sctp_packet_config (packet, vtag,0 );
Signature · 1 line
1.6.5.2