[PATCH v1 25/25] j1939: transport: j1939_xtp_rx_abort_one: propagate abort err to the socket

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

 



Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 net/can/j1939/transport.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
index c1ad1de96d2c..47ed93b510bc 100644
--- a/net/can/j1939/transport.c
+++ b/net/can/j1939/transport.c
@@ -937,14 +937,19 @@ static void j1939_xtp_rx_abort_one(struct j1939_priv *priv, struct sk_buff *skb,
 	session = j1939_session_get_by_skcb(priv, skcb, extd, reverse);
 	if (!session)
 		return;
+
 	if (session->transmission && !session->last_txcmd) {
 		/* empty block:
 		 * do not drop session when a transmit session did not
 		 * start yet
 		 */
 	} else if (session->skcb.addr.dst_pgn == pgn) {
+		u8 abort = skb->data[1];
+
 		j1939_session_timers_cancel(session);
-		j1939_session_cancel(session, J1939_XTP_NO_ABORT);
+		if (session->sk)
+			j1939_sk_send_multi_abort(priv, session->sk,
+						  j1939_xtp_abort_to_errno(priv, abort));
 	}
 
 	/* TODO: maybe cancel current connection
-- 
2.20.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux