[PATCH] sctp: do not send packet to response OOTB packet if no route exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <yjwei@xxxxxxxxxxxxxx>
---
 net/sctp/sm_statefuns.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 47bc20d..2847861 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -5835,6 +5835,12 @@ static struct sctp_packet *sctp_ootb_pkt_new(const struct sctp_association *asoc
 	sctp_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);
 
-- 
1.6.5.2


--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Networking Development]     [Linux OMAP]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux