]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit '2679de7a3' into thread-next
authorMaria Matejka <mq@ucw.cz>
Mon, 10 Mar 2025 09:51:25 +0000 (10:51 +0100)
committerMaria Matejka <mq@ucw.cz>
Mon, 10 Mar 2025 09:51:25 +0000 (10:51 +0100)
1  2 
.gitlab-ci.yml
INSTALL
conf/conf.h
doc/bird.sgml
nest/config.Y
nest/protocol.h
proto/bgp/bgp.c
proto/bgp/bgp.h
proto/bgp/packets.c

diff --cc .gitlab-ci.yml
Simple merge
diff --cc INSTALL
Simple merge
diff --cc conf/conf.h
index 03ef4ef823e2b0c5f8b6b3f3fbe1923bdca3f800,921ebb69daa291a56b4f4f4ac98a899236f8eff6..f912dcb718151102730aa55cc6fb9c8d32427c80
@@@ -46,18 -44,9 +47,17 @@@ struct config 
    struct timeformat tf_log;           /* Time format for the logfile */
    struct timeformat tf_base;          /* Time format for other purposes */
    u32 gr_wait;                                /* Graceful restart wait timeout (sec) */
-   const char *hostname;                       /* Hostname */
  
    int cli_debug;                      /* Tracing of CLI connections and commands */
 -  int latency_debug;                  /* I/O loop tracks duration of each event */
 +  enum latency_debug_flags {
 +    DL_PING = 1,
 +    DL_WAKEUP = 2,
 +    DL_SCHEDULING = 4,
 +    DL_ALLOCATOR = 8,
 +    DL_SOCKETS = 0x10,
 +    DL_EVENTS = 0x20,
 +    DL_TIMERS = 0x40,
 +  } latency_debug;                    /* I/O loops log information about task scheduling */
    u32 latency_limit;                  /* Events with longer duration are logged (us) */
    u32 watchdog_warning;                       /* I/O loop watchdog limit for warning (us) */
    u32 watchdog_timeout;                       /* Watchdog timeout (in seconds, 0 = disabled) */
diff --cc doc/bird.sgml
Simple merge
diff --cc nest/config.Y
index 30ecc819bed22b012a4fc920e5614e242d348174,4e5095bdc79f08ac5da73f40368b22f8982b87fe..ba6ea7ec2908a9559f8966994d6f04acd0de2849
@@@ -347,9 -302,10 +347,10 @@@ proto_item
   | DEBUG debug_mask { this_proto->debug = $2; }
   | MRTDUMP mrtdump_mask { this_proto->mrtdump = $2; }
   | ROUTER ID idval { this_proto->router_id = $3; }
+  | HOSTNAME text { this_proto->hostname = $2; }
   | DESCRIPTION text { this_proto->dsc = $2; }
 - | VRF text { this_proto->vrf = if_get_by_name($2); this_proto->vrf_set = 1; }
 - | VRF DEFAULT { this_proto->vrf = NULL; this_proto->vrf_set = 1; }
 + | VRF text { this_proto->vrf = if_get_by_name($2); }
 + | VRF DEFAULT { this_proto->vrf = &default_vrf; }
   ;
  
  
diff --cc nest/protocol.h
index ec561b2636084d30488f51d909b924514ab9bc49,97a2ba4065ad18365fd565395c20385f6de77da7..b2f52cca9b74e91bbe8f7b722f17de0519851fdd
@@@ -110,12 -124,10 +110,13 @@@ struct proto_config 
    int class;                          /* SYM_PROTO or SYM_TEMPLATE */
    u8 net_type;                                /* Protocol network type (NET_*), 0 for undefined */
    u8 disabled;                                /* Protocol enabled/disabled by default */
 -  u8 vrf_set;                         /* Related VRF instance (below) is defined */
 +  u8 late_if_feed;                    /* Delay interface feed after channels are up */
    u32 debug, mrtdump;                 /* Debugging bitfields, both use D_* constants */
    u32 router_id;                      /* Protocol specific router ID */
+   const char *hostname;                       /* Protocol specific hostname */
 +  uint loop_order;                    /* Launch a birdloop on this locking level; use DOMAIN_ORDER(the_bird) for mainloop */
 +  btime loop_max_latency;             /* Request this specific maximum latency of loop; zero to default */
 +  btime restart_limit;                        /* Minimum allowed time between limit restarts */
  
    list channels;                      /* List of channel configs (struct channel_config) */
    struct iface *vrf;                  /* Related VRF instance, NULL if global */
@@@ -309,11 -309,18 +310,17 @@@ static inline struct domain_generic *pr
  static inline u32
  proto_get_router_id(struct proto_config *pc)
  {
 -  return pc->router_id ? pc->router_id : pc->global->router_id;
 +  return pc->router_id ?: atomic_load_explicit(&global_runtime, memory_order_relaxed)->router_id;
  }
  
+ static inline const char*
+ proto_get_hostname(struct proto_config *pc)
+ {
+   return pc->hostname ? pc->hostname : pc->global->hostname;
+ }
  
  extern pool *proto_pool;
 -extern list proto_list;
  
  /*
   *  Each protocol instance runs two different state machines:
diff --cc proto/bgp/bgp.c
index f3968b08594fb5dad6a87dcf49e3087d002340e4,e17f47ae05ac7169b1efa277a40b62359ab12891..f602c01dc6211b1b994531c5c8b7ef0da7e1d463
@@@ -3018,34 -2733,18 +3023,38 @@@ bgp_show_proto_info(struct proto *P
          cli_msg(-1006, "    BGP Next hop:   %I %I", c->next_hop_addr, c->link_addr);
        }
  
-       if (c->igp_table_ip4)
-       cli_msg(-1006, "    IGP IPv4 table: %s", c->igp_table_ip4->name);
+       /* After channel is deconfigured, these pointers are no longer valid */
+       if (!p->p.reconfiguring || (c->c.channel_state != CS_DOWN))
+       {
+       if (c->igp_table_ip4)
+         cli_msg(-1006, "    IGP IPv4 table: %s", c->igp_table_ip4->name);
  
-       if (c->igp_table_ip6)
-       cli_msg(-1006, "    IGP IPv6 table: %s", c->igp_table_ip6->name);
+       if (c->igp_table_ip6)
+         cli_msg(-1006, "    IGP IPv6 table: %s", c->igp_table_ip6->name);
  
-       if (c->base_table)
-       cli_msg(-1006, "    Base table:     %s", c->base_table->name);
+       if (c->base_table)
+         cli_msg(-1006, "    Base table:     %s", c->base_table->name);
+       }
 +
 +      if (!c->tx)
 +      continue;
 +
 +      BGP_PTX_LOCK(c->tx, tx);
 +
 +      uint bucket_cnt = 0;
 +      uint prefix_cnt = 0;
 +      struct bgp_bucket *buck;
 +      struct bgp_prefix *px;
 +      WALK_LIST(buck, tx->bucket_queue)
 +      {
 +      bucket_cnt++;
 +      WALK_LIST(px, buck->prefixes)
 +        if (px->cur)
 +          prefix_cnt++;
 +      }
 +
 +      cli_msg(-1006, "    Pending %u attribute sets with total %u prefixes to send",
 +       bucket_cnt, prefix_cnt);
      }
    }
  }
diff --cc proto/bgp/bgp.h
Simple merge
Simple merge