mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sctp: handle error of sctp_sf_heartbeat() in sctp_sf_do_asconf()
@ 2025-03-12  3:21 Wentao Liang
  2025-03-12 12:33 ` Markus Elfring
  2025-03-12 15:30 ` Xin Long
  0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2025-03-12  3:21 UTC (permalink / raw)
  To: marcelo.leitner, lucien.xin, davem, edumazet, kuba, pabeni
  Cc: horms, linux-sctp, netdev, linux-kernel, Wentao Liang

In sctp_sf_do_asconf(), SCTP_DISPOSITION_NOMEM error code returned
from sctp_sf_heartbeat() represent a failure of sent HEARTBEAT. The
return value of sctp_sf_heartbeat() needs to be checked and propagates
to caller function.

Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
 net/sctp/sm_statefuns.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index a0524ba8d787..89100546670a 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -3973,8 +3973,10 @@ enum sctp_disposition sctp_sf_do_asconf(struct net *net,
 	asconf_ack->dest = chunk->source;
 	sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(asconf_ack));
 	if (asoc->new_transport) {
-		sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, commands);
-		((struct sctp_association *)asoc)->new_transport = NULL;
+		if (SCTP_DISPOSITION_NOMEM == sctp_sf_heartbeat(ep, asoc, type, asoc->new_transport, commands)) {
+			((struct sctp_association *)asoc)->new_transport = NULL;
+			return SCTP_DISPOSITION_NOMEM;
+		}
 	}
 
 	return SCTP_DISPOSITION_CONSUME;
-- 
2.42.0.windows.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-03-12 15:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-12  3:21 [PATCH] sctp: handle error of sctp_sf_heartbeat() in sctp_sf_do_asconf() Wentao Liang
2025-03-12 12:33 ` Markus Elfring
2025-03-12 15:30 ` Xin Long

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®