From: Maria Matejka Date: Mon, 23 Jan 2023 18:46:26 +0000 (+0100) Subject: Merge commit '7fb23041a52d01754c53ba963e2282e524813364' into thread-next X-Git-Tag: v3.0-alpha1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=758aabd96c0f09709183dff4261ffbfdd72ae870;p=thirdparty%2Fbird.git Merge commit '7fb23041a52d01754c53ba963e2282e524813364' into thread-next --- 758aabd96c0f09709183dff4261ffbfdd72ae870 diff --cc filter/config.Y index 7f1526593,1d9d9aa97..e6264a83c --- a/filter/config.Y +++ b/filter/config.Y @@@ -994,14 -971,14 +993,14 @@@ cmd } | function_call ';' { $$ = f_new_inst(FI_DROP_RESULT, $1); } | CASE term '{' switch_body '}' { - $$ = f_new_inst(FI_SWITCH, $2, build_tree($4)); + $$ = f_new_inst(FI_SWITCH, $2, $4); } - | dynamic_attr '.' EMPTY ';' { $$ = f_generate_empty($1); } - | dynamic_attr '.' PREPEND '(' term ')' ';' { $$ = f_generate_complex( FI_PATH_PREPEND, $1, $5 ); } - | dynamic_attr '.' ADD '(' term ')' ';' { $$ = f_generate_complex( FI_CLIST_ADD, $1, $5 ); } - | dynamic_attr '.' DELETE '(' term ')' ';' { $$ = f_generate_complex( FI_CLIST_DEL, $1, $5 ); } - | dynamic_attr '.' FILTER '(' term ')' ';' { $$ = f_generate_complex( FI_CLIST_FILTER, $1, $5 ); } + | symbol_known '.' EMPTY ';' { $$ = f_generate_empty($1); } + | symbol_known '.' PREPEND '(' term ')' ';' { $$ = f_generate_complex_sym( FI_PATH_PREPEND, $1, $5 ); } + | symbol_known '.' ADD '(' term ')' ';' { $$ = f_generate_complex_sym( FI_CLIST_ADD, $1, $5 ); } + | symbol_known '.' DELETE '(' term ')' ';' { $$ = f_generate_complex_sym( FI_CLIST_DEL, $1, $5 ); } + | symbol_known '.' FILTER '(' term ')' ';' { $$ = f_generate_complex_sym( FI_CLIST_FILTER, $1, $5 ); } | BT_ASSERT '(' get_cf_position term get_cf_position ')' ';' { $$ = assert_done($4, $3 + 1, $5 - 1); } | BT_CHECK_ASSIGN '(' get_cf_position lvalue get_cf_position ',' term ')' ';' { $$ = assert_assign(&$4, $7, $3 + 1, $5 - 1); } ; diff --cc sysdep/bsd/krt-sock.c index fcf9ac4dd,540c246f3..8e457c794 --- a/sysdep/bsd/krt-sock.c +++ b/sysdep/bsd/krt-sock.c @@@ -238,8 -251,12 +258,12 @@@ krt_send_route(struct krt_proto *p, in msg.rtm.rtm_tableid = KRT_CF->sys.table_id; #endif + #ifdef KRT_USE_METRIC + msg.rtm.rtm_priority = KRT_CF->sys.metric; + #endif + #ifdef RTF_REJECT - if(a->dest == RTD_UNREACHABLE) + if(dest == RTD_UNREACHABLE) msg.rtm.rtm_flags |= RTF_REJECT; #endif #ifdef RTF_BLACKHOLE @@@ -594,19 -606,33 +618,24 @@@ krt_read_route(struct ks_msg *msg, stru } } - done: - e = rte_get_temp(&a, p->p.main_source); - e->net = net; + nhad.ad.length = (void *) NEXTHOP_NEXT(&nhad.nh) - (void *) nhad.ad.data; - ea_list *ea = alloca(sizeof(ea_list) + 2 * sizeof(eattr)); - *ea = (ea_list) { .count = 1, .next = e->attrs->eattrs }; - e->attrs->eattrs = ea; + done: + ea_set_attr(&eattrs, EA_LITERAL_DIRECT_ADATA(&ea_gen_nexthop, 0, &nhad.ad)); + rte e0 = { .attrs = eattrs, .net = &ndst, }; - ea->attrs[0] = (eattr) { - .id = EA_KRT_SOURCE, - .type = EAF_TYPE_INT, - .u.data = src2, - }; + ea_set_attr(&e0.attrs, + EA_LITERAL_EMBEDDED(&ea_krt_source, 0, src2)); + #ifdef KRT_USE_METRIC - ea->count++; - ea->attrs[1] = (eattr) { - .id = EA_KRT_METRIC, - .type = EAF_TYPE_INT, - .u.data = msg->rtm.rtm_priority, - }; ++ ea_set_attr(&e0.attrs, ++ EA_LITERAL_EMBEDDED(&ea_krt_metric, 0, msg->rtm.rtm_priority)); + #endif + if (scan) - krt_got_route(p, e, src); + krt_got_route(p, &e0, src); else - krt_got_route_async(p, e, new, src); + krt_got_route_async(p, &e0, new, src); } static void diff --cc sysdep/unix/log.c index 185231e87,53122aee3..d09481bc2 --- a/sysdep/unix/log.c +++ b/sysdep/unix/log.c @@@ -439,10 -438,10 +455,12 @@@ done void log_init_debug(char *f) { + clock_gettime(CLOCK_MONOTONIC, &dbg_time_start); + + dbg_fd = -1; if (dbgf && dbgf != stderr) fclose(dbgf); + if (!f) dbgf = NULL; else if (!*f)