From: Maria Matejka Date: Thu, 28 Nov 2024 11:07:30 +0000 (+0100) Subject: Merge commit '08ff0af8' into thread-merge-2.16 X-Git-Tag: v3.0.0~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eba3a26537c7ef28279a3fb163a658421adc9cb8;p=thirdparty%2Fbird.git Merge commit '08ff0af8' into thread-merge-2.16 --- eba3a26537c7ef28279a3fb163a658421adc9cb8 diff --cc conf/confbase.Y index f3b0db617,cdbdf1ce2..99fb3d7ab --- a/conf/confbase.Y +++ b/conf/confbase.Y @@@ -101,11 -97,9 +101,10 @@@ CF_DECL struct proto_spec ps; struct channel_limit cl; struct timeformat *tf; - mpls_label_stack *mls; + struct settle_config settle; + struct adata *ad; const struct adata *bs; struct aggr_item_node *ai; - struct cli_config *cli; } %token END CLI_MARKER INVALID_TOKEN ELSECOL DDOT diff --cc nest/cli.c index e40ae1d97,4601f8633..dd0ce4079 --- a/nest/cli.c +++ b/nest/cli.c @@@ -272,9 -306,9 +272,9 @@@ cli_event(void *data } cli * - cli_new(struct birdsock *sock) -cli_new(void *priv, struct cli_config *cf) ++cli_new(struct birdsock *sock, struct cli_config *cf) { - pool *p = rp_new(cli_pool, "CLI"); + pool *p = rp_new(cli_pool, the_bird_domain.the_bird, "CLI"); cli *c = mb_alloc(p, sizeof(cli)); bzero(c, sizeof(cli)); @@@ -285,7 -319,12 +285,11 @@@ c->event->data = c; c->cont = cli_hello; c->parser_pool = lp_new_default(c->pool); - c->show_pool = lp_new_default(c->pool); c->rx_buf = mb_alloc(c->pool, CLI_RX_BUF_SIZE); + + if (cf->restricted) + c->restricted = 1; + ev_schedule(c->event); return c; } diff --cc nest/cli.h index 0bfd7b46e,afcb6d552..c3dfc3eb5 --- a/nest/cli.h +++ b/nest/cli.h @@@ -78,7 -82,7 +79,7 @@@ static inline void cli_separator(cli *c /* Functions provided to sysdep layer */ - cli *cli_new(struct birdsock *); -cli *cli_new(void *, struct cli_config *); ++cli *cli_new(struct birdsock *, struct cli_config *); void cli_init(void); void cli_free(cli *); void cli_kick(cli *); diff --cc sysdep/unix/config.Y index 29dd31c16,7607f34aa..25eb36ede --- a/sysdep/unix/config.Y +++ b/sysdep/unix/config.Y @@@ -17,13 -18,11 +18,12 @@@ static struct cli_config *this_cli_conf CF_DECLS -CF_KEYWORDS(LOG, SYSLOG, NAME, STDERR, UDP, PORT, CLI) -CF_KEYWORDS(ALL, DEBUG, TRACE, INFO, REMOTE, WARNING, ERROR, AUTH, FATAL, BUG) -CF_KEYWORDS(DEBUG, LATENCY, LIMIT, WATCHDOG, WARNING, TIMEOUT, THREADS) +CF_KEYWORDS(LOG, SYSLOG, ALL, DEBUG, TRACE, INFO, REMOTE, WARNING, ERROR, AUTH, FATAL, BUG, STDERR, SOFT, UDP, PORT, CLI) +CF_KEYWORDS(NAME, CONFIRM, UNDO, CHECK, TIMEOUT, DEBUG, LATENCY, LIMIT, WATCHDOG, WARNING, STATUS) +CF_KEYWORDS(PING, WAKEUP, SOCKETS, SCHEDULING, EVENTS, TIMERS, ALLOCATOR) +CF_KEYWORDS(GRACEFUL, RESTART, FIXED) - %type cli_opts -%type log_mask log_mask_list log_cat cfg_timeout +%type log_mask log_mask_list log_cat cfg_timeout debug_unix latency_debug_mask latency_debug_flag latency_debug_list %type cfg_name %type timeformat_which %type syslog_name @@@ -138,12 -142,11 +141,17 @@@ cli_opts_begin: }; }; + cli_opts_block: + /* EMPTY */ | + cli_opts_block RESTRICT { this_cli_config->restricted = 1; } + ; + +conf: THREADS expr { + if ($2 < 1) cf_error("Number of threads must be at least one."); + new_config->thread_count = $2; +} + + conf: debug_unix ; debug_unix: