Skip to content

Commit 45e66fc

Browse files
Fix incorrect chunk type Display for CWR (#245)
1 parent e04c4c1 commit 45e66fc

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

sctp/src/chunk/chunk_test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ fn test_chunk_type_string() -> Result<()> {
2020
(CT_ERROR, "ERROR"),
2121
(CT_COOKIE_ECHO, "COOKIE-ECHO"),
2222
(CT_COOKIE_ACK, "COOKIE-ACK"),
23-
(CT_CWR, "ECNE"),
23+
(CT_ECNE, "ECNE"),
24+
(CT_CWR, "CWR"),
2425
(CT_SHUTDOWN_COMPLETE, "SHUTDOWN-COMPLETE"),
2526
(CT_RECONFIG, "RECONFIG"),
2627
(CT_FORWARD_TSN, "FORWARD-TSN"),

sctp/src/chunk/chunk_type.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pub(crate) const CT_SHUTDOWN_ACK: ChunkType = ChunkType(8);
1818
pub(crate) const CT_ERROR: ChunkType = ChunkType(9);
1919
pub(crate) const CT_COOKIE_ECHO: ChunkType = ChunkType(10);
2020
pub(crate) const CT_COOKIE_ACK: ChunkType = ChunkType(11);
21+
pub(crate) const CT_ECNE: ChunkType = ChunkType(12);
2122
pub(crate) const CT_CWR: ChunkType = ChunkType(13);
2223
pub(crate) const CT_SHUTDOWN_COMPLETE: ChunkType = ChunkType(14);
2324
pub(crate) const CT_RECONFIG: ChunkType = ChunkType(130);
@@ -39,7 +40,8 @@ impl fmt::Display for ChunkType {
3940
CT_ERROR => "ERROR",
4041
CT_COOKIE_ECHO => "COOKIE-ECHO",
4142
CT_COOKIE_ACK => "COOKIE-ACK",
42-
CT_CWR => "ECNE", // Explicit Congestion Notification Echo
43+
CT_ECNE => "ECNE", // Explicit Congestion Notification Echo
44+
CT_CWR => "CWR", // Reserved for Congestion Window Reduced (CWR)
4345
CT_SHUTDOWN_COMPLETE => "SHUTDOWN-COMPLETE",
4446
CT_RECONFIG => "RECONFIG", // Re-configuration
4547
CT_FORWARD_TSN => "FORWARD-TSN",
@@ -68,7 +70,8 @@ mod test {
6870
(CT_ERROR, "ERROR"),
6971
(CT_COOKIE_ECHO, "COOKIE-ECHO"),
7072
(CT_COOKIE_ACK, "COOKIE-ACK"),
71-
(CT_CWR, "ECNE"),
73+
(CT_ECNE, "ECNE"),
74+
(CT_CWR, "CWR"),
7275
(CT_SHUTDOWN_COMPLETE, "SHUTDOWN-COMPLETE"),
7376
(CT_RECONFIG, "RECONFIG"),
7477
(CT_FORWARD_TSN, "FORWARD-TSN"),

0 commit comments

Comments
 (0)