aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2023-08-04 19:37:26 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2023-08-07 19:16:24 +0200
commita49a2b4d704a502513cd012add3d0a1f7576e7b0 (patch)
treebd611e89c3b70ee73a2eff76a40a2e918581d4ab /src
parentbcfa37ade0a8ec3e325347adb23ba3cc102e0554 (diff)
stream_srv: Log SCTP REMOTE_ERROR events
The event was enabled but was not being logged. Change-Id: I49f5a648fd474e320101424fb6873a37442339bf
Diffstat (limited to 'src')
-rw-r--r--src/sctp.c18
-rw-r--r--src/stream_srv.c4
2 files changed, 22 insertions, 0 deletions
diff --git a/src/sctp.c b/src/sctp.c
index c1b57db..7f4f54b 100644
--- a/src/sctp.c
+++ b/src/sctp.c
@@ -51,3 +51,21 @@ const struct value_string osmo_sctp_sn_error_strs[] = {
{ SCTP_PEER_FAULTY, "PEER_FAULTY" },
{ 0, NULL }
};
+
+/* rfc4960 section 3.3.10 "Operation Error", in host byte order */
+const struct value_string osmo_sctp_op_error_strs[] = {
+ { OSMO_SCTP_OP_ERR_INVALID_STREAM_ID, "Invalid Stream Identifier" },
+ { OSMO_SCTP_OP_ERR_MISS_MAND_PARAM, "Missing Mandatory Parameter" },
+ { OSMO_SCTP_OP_ERR_STALE_COOKIE, "Stale Cookie Error" },
+ { OSMO_SCTP_OP_ERR_NO_RESOURCES, "Out of Resource" },
+ { OSMO_SCTP_OP_ERR_UNRESOLV_ADDR, "Unresolvable Address" },
+ { OSMO_SCTP_OP_ERR_UNKN_CHUNK_TYPE, "Unrecognized Chunk Type" },
+ { OSMO_SCTP_OP_ERR_INVALID_MAND_PARAM, "Invalid Mandatory Parameter" },
+ { OSMO_SCTP_OP_ERR_UNKN_PARAM, "Unrecognized Parameters" },
+ { OSMO_SCTP_OP_ERR_NO_USER_DATA, "No User Data" },
+ { OSMO_SCTP_OP_ERR_COOKIE_RX_WHILE_SHUTDOWN, "Cookie Received While Shutting Down" },
+ { OSMO_SCTP_OP_ERR_RESTART_ASSC_NEW_ADDR, "Restart of an Association with New Addresses" },
+ { OSMO_SCTP_OP_ERR_UNER_INITED_ABORT, "User Initiated Abort" },
+ { OSMO_SCTP_OP_ERR_PROTO_VERSION, "Protocol Violation" },
+ { 0, NULL }
+};
diff --git a/src/stream_srv.c b/src/stream_srv.c
index 6c50a69..3625ffd 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -891,6 +891,10 @@ static int _sctp_recvmsg_wrapper(int fd, struct msgb *msg)
/* RFC6458 3.1.4: Any attempt to send more data will cause sendmsg()
* to return with an ESHUTDOWN error. */
break;
+ case SCTP_REMOTE_ERROR:
+ LOGP(DLINP, LOGL_DEBUG, "===> REMOTE ERROR: %s\n",
+ osmo_sctp_op_error_str(ntohs(notif->sn_remote_error.sre_error)));
+ break;
}
return -EAGAIN;
}