Skip to contentSkip to conversation

sctp: fix the incorrect revert

PATCH Applied Xin Long 2 participants 4 messages May 2, 2021 – May 3, 2021

Subsystems (3)
lore
Share & tools
lore

Xin Long

author maintainer
#0 lore raw

cover sctp: fix the incorrect revert

commit 35b4f24415c8 ("sctp: do asoc update earlier in sctp_sf_do_dupcook_a") only keeps the SHUTDOWN and COOKIE-ACK with the same asoc, not transport.

So instead of revert commit 145cb2f7177d ("sctp: Fix bundling of SHUTDOWN with COOKIE-ACK"), we should revert 12dfd78e3a74 ("sctp: Fix SHUTDOWN CTSN Ack in the peer restart case").

Xin Long (2):
Revert "Revert "sctp: Fix bundling of SHUTDOWN with COOKIE-ACK"" Revert "sctp: Fix SHUTDOWN CTSN Ack in the peer restart case"

 net/sctp/sm_make_chunk.c | 6 +-----
 net/sctp/sm_statefuns.c  | 6 +++---
 2 files changed, 4 insertions(+), 8 deletions(-)
Signature · 1 line
2.1.0
author maintainer
#1 lore raw

PATCH 1/2 Revert "Revert "sctp: Fix bundling of SHUTDOWN with COOKIE-ACK""

This reverts commit 7e9269a5acec6d841d22e12770a0b02db4f5d8f2.

As Jere notice, commit 35b4f24415c8 ("sctp: do asoc update earlier in sctp_sf_do_dupcook_a") only keeps the SHUTDOWN and COOKIE-ACK with the same asoc, not transport. So we have to bring this patch back.

---
 net/sctp/sm_statefuns.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
net/sctp/sm_statefuns.c +3 -3
index a428449..5fc3f3a 100644
@@ -1903,7 +1903,7 @@ static enum sctp_disposition sctp_sf_do_dupcook_a(
 		 */
 		sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
 		return sctp_sf_do_9_2_start_shutdown(net, ep, asoc,
-						     SCTP_ST_CHUNK(0), NULL,
+						     SCTP_ST_CHUNK(0), repl,
 						     commands);
 	} else {
 		sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE,
@@ -5549,7 +5549,7 @@ enum sctp_disposition sctp_sf_do_9_2_start_shutdown(
 	 * in the Cumulative TSN Ack field the last sequential TSN it
 	 * has received from the peer.
 	 */
-	reply = sctp_make_shutdown(asoc, NULL);
+	reply = sctp_make_shutdown(asoc, arg);
 	if (!reply)
 		goto nomem;
 
@@ -6147,7 +6147,7 @@ enum sctp_disposition sctp_sf_autoclose_timer_expire(
 	disposition = SCTP_DISPOSITION_CONSUME;
 	if (sctp_outq_is_empty(&asoc->outqueue)) {
 		disposition = sctp_sf_do_9_2_start_shutdown(net, ep, asoc, type,
-							    arg, commands);
+							    NULL, commands);
 	}
 
 	return disposition;
Signature · 1 line
2.1.0
author maintainer
#2 lore raw

PATCH 2/2 Revert "sctp: Fix SHUTDOWN CTSN Ack in the peer restart case"

This reverts commit 12dfd78e3a74825e6f0bc8df7ef9f938fbc6bfe3.

This can be reverted as shutdown and cookie_ack chunk are using the same asoc since commit 35b4f24415c8 ("sctp: do asoc update earlier in sctp_sf_do_dupcook_a").

---
 net/sctp/sm_make_chunk.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
net/sctp/sm_make_chunk.c +1 -5
index 5f9a7c0..5b44d22 100644
@@ -858,11 +858,7 @@ struct sctp_chunk *sctp_make_shutdown(const struct sctp_association *asoc,
 	struct sctp_chunk *retval;
 	__u32 ctsn;
 
-	if (chunk && chunk->asoc)
-		ctsn = sctp_tsnmap_get_ctsn(&chunk->asoc->peer.tsn_map);
-	else
-		ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
-
+	ctsn = sctp_tsnmap_get_ctsn(&asoc->peer.tsn_map);
 	shut.cum_tsn_ack = htonl(ctsn);
 
 	retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN, 0,
Signature · 1 line
2.1.0
#3 lore raw
In reply to Xin Long
This series was applied to netdev/net.git (refs/heads/master):

Hello:

This series was applied to netdev/net.git (refs/heads/master):

Quoted 9 lines · On Mon, 3 May 2021 04:36:57 +0800 you wrote:

commit 35b4f24415c8 ("sctp: do asoc update earlier in sctp_sf_do_dupcook_a") only keeps the SHUTDOWN and COOKIE-ACK with the same asoc, not transport.

So instead of revert commit 145cb2f7177d ("sctp: Fix bundling of SHUTDOWN with COOKIE-ACK"), we should revert 12dfd78e3a74 ("sctp: Fix SHUTDOWN CTSN Ack in the peer restart case").

[...]

Here is the summary with links:
- [net,1/2] Revert "Revert "sctp: Fix bundling of SHUTDOWN with COOKIE-ACK""

    https://git.kernel.org/netdev/net/c/22008f560bd3
  - [net,2/2] Revert "sctp: Fix SHUTDOWN CTSN Ack in the peer restart case"
    https://git.kernel.org/netdev/net/c/7aa4e54739be

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html