summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss White <russ@riw.us>2024-02-13 09:50:00 -0500
committerGitHub <noreply@github.com>2024-02-13 09:50:00 -0500
commite74c3b0746854486630e267952edf2a829964959 (patch)
tree65b68a1210cdbc741a82e51405774d87ce40183b
parent17a0a625f0589ebdf28f6407bc6be21dbdbaabfd (diff)
parent729dd6f6261933d51a49d68995ff70b6d015e4b5 (diff)
Merge pull request #15320 from donaldsharp/vtysh_limit_fds
lib, ospfclient, vtysh: Allow for a minimum fd poll size
-rw-r--r--lib/event.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/event.c b/lib/event.c
index 6427705e90..fc46a11c0b 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -570,9 +570,12 @@ struct event_loop *event_master_create(const char *name)
rv->fd_limit = (int)limit.rlim_cur;
}
- if (rv->fd_limit > STUPIDLY_LARGE_FD_SIZE)
- zlog_warn("FD Limit set: %u is stupidly large. Is this what you intended? Consider using --limit-fds",
- rv->fd_limit);
+ if (rv->fd_limit > STUPIDLY_LARGE_FD_SIZE) {
+ zlog_warn("FD Limit set: %u is stupidly large. Is this what you intended? Consider using --limit-fds also limiting size to %u",
+ rv->fd_limit, STUPIDLY_LARGE_FD_SIZE);
+
+ rv->fd_limit = STUPIDLY_LARGE_FD_SIZE;
+ }
rv->read = XCALLOC(MTYPE_EVENT_POLL,
sizeof(struct event *) * rv->fd_limit);