[ipfw2] override errx() to prevent exit on error (#3840)

In ipfw2.c errx() would call exit(), aborting the UPF thread on rule parse
errors. Add a macro mapping errx() to ogs_log_message() so errors are logged.
We no longer call exit() and the main loop continues on error.
This commit is contained in:
Sukchan Lee
2025-05-09 16:47:42 +09:00
parent 3a91d2aa3f
commit 78ea40881c

View File

@@ -73,6 +73,10 @@ int resvd_set_number = RESVD_SET;
int ipfw_socket = -1; int ipfw_socket = -1;
#if 1 /* modifed by acetcom */
#define errx(eval, ...) ogs_log_message(OGS_LOG_ERROR, 0, __VA_ARGS__)
#endif
#define CHECK_LENGTH(v, len) do { \ #define CHECK_LENGTH(v, len) do { \
if ((v) < (len)) \ if ((v) < (len)) \
errx(EX_DATAERR, "Rule too long"); \ errx(EX_DATAERR, "Rule too long"); \