]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit '3186ffe79714a48542d5ad61a94c81216b522fd0' into thread-next
authorMaria Matejka <mq@ucw.cz>
Tue, 24 Jan 2023 08:45:40 +0000 (09:45 +0100)
committerMaria Matejka <mq@ucw.cz>
Tue, 24 Jan 2023 08:45:40 +0000 (09:45 +0100)
1  2 
filter/test.conf
proto/bgp/bgp.c
proto/bgp/bgp.h
proto/bgp/packets.c
proto/pipe/pipe.c
sysdep/unix/alloc.c

index 9b24a40806b41fe61c279e8eea06a33ff5b610ac,1d291c695b2cf073b446e0fc34c9636b6800c115..17aaf8cfd2171edb70f5bd6b1aaed8eabb77e4bd
@@@ -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.c
Simple merge
diff --cc proto/bgp/bgp.h
index 5a68002225780db55dd416de8fac793b31c715a4,2808d479f136958b37cf93b882175a4352a891f4..6402921ae7e33ef31fa54cb86c7e5b01e00511d9
@@@ -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
Simple merge
index 0b0d9151e54d707c5ad7a1c441f0666131cdc338,d48ce3870f2b9469ae5bb272ddd2146f4299955e..9d1bb6cee0f5b6483cb004f85e475d9b244fb3d1
  
  #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;
index 04cf7498c1ff22fba170eb096d2b400113aafee3,c8f1c83fa08d19d02a2402d07dbece64f9248ffd..6c68a865db37186ce7015e6f59a29cde2c593927
@@@ -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;
  }