From: Maria Matejka Date: Tue, 24 Jan 2023 08:45:40 +0000 (+0100) Subject: Merge commit '3186ffe79714a48542d5ad61a94c81216b522fd0' into thread-next X-Git-Tag: v3.0-alpha1~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02b2a4ecaaf850ce04b0cd2e74c1ff6fede3f181;p=thirdparty%2Fbird.git Merge commit '3186ffe79714a48542d5ad61a94c81216b522fd0' into thread-next --- 02b2a4ecaaf850ce04b0cd2e74c1ff6fede3f181 diff --cc filter/test.conf index 9b24a4080,1d291c695..17aaf8cfd --- a/filter/test.conf +++ b/filter/test.conf @@@ -212,13 -110,17 +212,25 @@@ function t_int( bt_assert(1 <= 1); bt_assert(!(1234 < 1234)); + bt_assert(10 - 5 = 5); + bt_assert(4294967295 + 1 = 0); + bt_assert(6*9=54); + bt_assert(984/41 = 24); + bt_assert(123/45 = 2); + bt_assert(0xfee1a | 0xbeef = 0xffeff); + bt_assert(0xfee1a & 0xbeef = 0xae0a); ++ + case i { + 4200000000: bt_assert(true); + else: bt_assert(false); + } + + case four { + 4: bt_assert(true); + else: bt_assert(false); + } + + } bt_test_suite(t_int, "Testing integers"); diff --cc proto/bgp/bgp.h index 5a6800222,2808d479f..6402921ae --- a/proto/bgp/bgp.h +++ b/proto/bgp/bgp.h @@@ -554,22 -539,14 +554,20 @@@ void bgp_refresh_begin(struct bgp_chann void bgp_refresh_end(struct bgp_channel *c); void bgp_store_error(struct bgp_proto *p, struct bgp_conn *c, u8 class, u32 code); void bgp_stop(struct bgp_proto *p, int subcode, byte *data, uint len); - - struct rte_source *bgp_find_source(struct bgp_proto *p, u32 path_id); - struct rte_source *bgp_get_source(struct bgp_proto *p, u32 path_id); + const char *bgp_format_role_name(u8 role); static inline int -rte_resolvable(rte *rt) +rte_resolvable(const rte *rt) { - return rt->attrs->dest != RTD_UNREACHABLE; + eattr *nhea = ea_find(rt->attrs, &ea_gen_nexthop); + if (!nhea) + return 0; + + struct nexthop_adata *nhad = (void *) nhea->u.ptr; + return NEXTHOP_IS_REACHABLE(nhad) || (nhad->dest != RTD_UNREACHABLE); } +extern struct rte_owner_class bgp_rte_owner_class; #ifdef LOCAL_DEBUG #define BGP_FORCE_DEBUG 1 diff --cc proto/pipe/pipe.c index 0b0d9151e,d48ce3870..9d1bb6cee --- a/proto/pipe/pipe.c +++ b/proto/pipe/pipe.c @@@ -43,12 -43,8 +43,8 @@@ #include "pipe.h" - #ifdef CONFIG_BGP - #include "proto/bgp/bgp.h" - #endif - static void -pipe_rt_notify(struct proto *P, struct channel *src_ch, net *n, rte *new, rte *old) +pipe_rt_notify(struct proto *P, struct channel *src_ch, const net_addr *n, rte *new, const rte *old) { struct pipe_proto *p = (void *) P; struct channel *dst = (src_ch == p->pri) ? p->sec : p->pri; diff --cc sysdep/unix/alloc.c index 04cf7498c,c8f1c83fa..6c68a865d --- a/sysdep/unix/alloc.c +++ b/sysdep/unix/alloc.c @@@ -75,10 -78,10 +78,10 @@@ static int pages_kept_here = 0 static void * alloc_sys_page(void) { - void *ptr = mmap(NULL, page_size, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + void *ptr = mmap(NULL, page_size * ALLOC_PAGES_AT_ONCE, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); if (ptr == MAP_FAILED) - bug("mmap(%lu) failed: %m", page_size); + die("mmap(%ld) failed: %m", (s64) page_size); return ptr; }