mirror of
https://github.com/open5gs/open5gs.git
synced 2025-11-02 21:13:40 +00:00
[AMF/MME] Remove fatal assertions on oversized SCTP messages in NGAP and S1AP handlers (#3878)
Previously, any SCTP recv would trigger ogs_fatal and an assert_if_reached when MSG_EOR wasn’t set, causing the AMF or MME to crash on oversized or fragmented packets. Since we rely on a 32 KB receive buffer and do not support SCTP reassembly, this change replaces the conditional fatal/assert logic with a single ogs_error call in both ngap_recv_handler and s1ap_recv_handler. Oversized or partial SCTP messages are now logged and dropped instead of crashing the process.
This commit is contained in:
@@ -243,14 +243,8 @@ void ngap_recv_handler(ogs_sock_t *sock)
|
|||||||
ngap_event_push(AMF_EVENT_NGAP_MESSAGE, sock, addr, pkbuf, 0, 0);
|
ngap_event_push(AMF_EVENT_NGAP_MESSAGE, sock, addr, pkbuf, 0, 0);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (ogs_socket_errno != OGS_EAGAIN) {
|
ogs_error("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)",
|
||||||
ogs_fatal("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)",
|
size, errno, strerror(errno), flags);
|
||||||
size, errno, strerror(errno), flags);
|
|
||||||
ogs_assert_if_reached();
|
|
||||||
} else {
|
|
||||||
ogs_error("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)",
|
|
||||||
size, errno, strerror(errno), flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ogs_pkbuf_free(pkbuf);
|
ogs_pkbuf_free(pkbuf);
|
||||||
|
|||||||
@@ -245,14 +245,8 @@ void s1ap_recv_handler(ogs_sock_t *sock)
|
|||||||
s1ap_event_push(MME_EVENT_S1AP_MESSAGE, sock, addr, pkbuf, 0, 0);
|
s1ap_event_push(MME_EVENT_S1AP_MESSAGE, sock, addr, pkbuf, 0, 0);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (ogs_socket_errno != OGS_EAGAIN) {
|
ogs_error("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)",
|
||||||
ogs_fatal("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)",
|
size, errno, strerror(errno), flags);
|
||||||
size, errno, strerror(errno), flags);
|
|
||||||
ogs_assert_if_reached();
|
|
||||||
} else {
|
|
||||||
ogs_error("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)",
|
|
||||||
size, errno, strerror(errno), flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ogs_pkbuf_free(pkbuf);
|
ogs_pkbuf_free(pkbuf);
|
||||||
|
|||||||
@@ -183,14 +183,8 @@ static void recv_handler(ogs_sock_t *sock)
|
|||||||
sgsap_event_push(MME_EVENT_SGSAP_MESSAGE, sock, NULL, pkbuf, 0, 0);
|
sgsap_event_push(MME_EVENT_SGSAP_MESSAGE, sock, NULL, pkbuf, 0, 0);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
if (ogs_socket_errno != OGS_EAGAIN) {
|
ogs_error("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)",
|
||||||
ogs_fatal("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)",
|
size, errno, strerror(errno), flags);
|
||||||
size, errno, strerror(errno), flags);
|
|
||||||
ogs_assert_if_reached();
|
|
||||||
} else {
|
|
||||||
ogs_error("ogs_sctp_recvmsg(%d) failed(%d:%s-0x%x)",
|
|
||||||
size, errno, strerror(errno), flags);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ogs_pkbuf_free(pkbuf);
|
ogs_pkbuf_free(pkbuf);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user