Skip to content

Commit

Permalink
Merge pull request #16542 from donaldsharp/vtysh_stupidly_large
Browse files Browse the repository at this point in the history
lib: Don't print warning if not a daemon
  • Loading branch information
ton31337 authored Aug 11, 2024
2 parents 3875588 + cecf571 commit 423e807
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/event.c
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,9 @@ struct event_loop *event_master_create(const char *name)
}

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);
if (frr_is_daemon())
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;
}
Expand Down
8 changes: 8 additions & 0 deletions lib/libfrr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1476,3 +1476,11 @@ const char *frr_vers2str(uint32_t version, char *buf, int buflen)

return buf;
}

bool frr_is_daemon(void)
{
if (di)
return true;

return false;
}
2 changes: 1 addition & 1 deletion lib/libfrr.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ extern const char *frr_get_progname(void);
extern enum frr_cli_mode frr_get_cli_mode(void);
extern uint32_t frr_get_fd_limit(void);
extern bool frr_is_startup_fd(int fd);

extern bool frr_is_daemon(void);
/* call order of these hooks is as ordered here */
DECLARE_HOOK(frr_early_init, (struct event_loop * tm), (tm));
DECLARE_HOOK(frr_late_init, (struct event_loop * tm), (tm));
Expand Down

0 comments on commit 423e807

Please sign in to comment.