]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit '17f91f9e6e70f7e3f29502e854823c0d48571eaa' into haugesund
authorMaria Matejka <mq@ucw.cz>
Mon, 30 May 2022 14:59:24 +0000 (16:59 +0200)
committerMaria Matejka <mq@ucw.cz>
Mon, 30 May 2022 14:59:24 +0000 (16:59 +0200)
27 files changed:
1  2 
conf/conf.h
filter/f-inst.c
filter/filter.h
lib/route.h
nest/config.Y
nest/proto.c
nest/protocol.h
nest/rt-dev.c
nest/rt-table.c
proto/babel/babel.c
proto/bfd/bfd.c
proto/bgp/attrs.c
proto/bgp/bgp.c
proto/bgp/bgp.h
proto/mrt/mrt.c
proto/ospf/ospf.c
proto/ospf/rt.c
proto/ospf/topology.c
proto/perf/perf.c
proto/pipe/pipe.c
proto/radv/radv.c
proto/rip/rip.c
proto/rpki/rpki.c
proto/static/static.c
sysdep/linux/netlink.c
sysdep/unix/krt.c
sysdep/unix/krt.h

diff --cc conf/conf.h
Simple merge
diff --cc filter/f-inst.c
Simple merge
diff --cc filter/filter.h
Simple merge
diff --cc lib/route.h
Simple merge
diff --cc nest/config.Y
Simple merge
diff --cc nest/proto.c
Simple merge
diff --cc nest/protocol.h
index b6aa6469792eed7445a17d2082f6dafcc5ae9bbf,8f0cc4b4eb7d0389ed9408bb470237ddab33b701..1d7dea4bf7d4a0e81543b423cf842950f04e204c
@@@ -77,9 -58,10 +59,9 @@@ struct protocol 
    void (*dump)(struct proto *);                       /* Debugging dump */
    int (*start)(struct proto *);                       /* Start the instance */
    int (*shutdown)(struct proto *);            /* Stop the instance */
 -  void (*cleanup)(struct proto *);            /* Called after shutdown when protocol became hungry/down */
    void (*get_status)(struct proto *, byte *buf); /* Get instance status (for `show protocols' command) */
    void (*get_route_info)(struct rte *, byte *buf); /* Get route information (for `show route' command) */
  int (*get_attr)(const struct eattr *, byte *buf, int buflen);       /* ASCIIfy dynamic attribute (returns GA_*) */
//  int (*get_attr)(const struct eattr *, byte *buf, int buflen);     /* ASCIIfy dynamic attribute (returns GA_*) */
    void (*show_proto_info)(struct proto *);    /* Show protocol info (for `show protocols all' command) */
    void (*copy_config)(struct proto_config *, struct proto_config *);  /* Copy config from given protocol instance */
  };
diff --cc nest/rt-dev.c
Simple merge
diff --cc nest/rt-table.c
Simple merge
Simple merge
diff --cc proto/bfd/bfd.c
Simple merge
index e6f11a88ac9c9d62986925918dd63924c7cf461b,72a4f68ad622718e7a76e56c21a35ef5b6410879..a713b7a2a16b0860c9c108918e8411021fe283b1
@@@ -357,13 -372,13 +372,13 @@@ bgp_aigp_set_metric(struct linpool *poo
  }
  
  int
 -bgp_total_aigp_metric_(rte *e, u64 *metric, const struct adata **ad)
 +bgp_total_aigp_metric_(struct rta *a, u64 *metric, const struct adata **ad)
  {
-   eattr *ea = ea_find(a->eattrs, EA_CODE(PROTOCOL_BGP, BA_AIGP));
 -  eattr *a = ea_find(e->attrs->eattrs, BGP_EA_ID(BA_AIGP));
 -  if (!a)
++  eattr *ea = ea_find(a->eattrs, BGP_EA_ID(BA_AIGP));
 +  if (!ea)
      return 0;
  
 -  const byte *b = bgp_aigp_get_tlv(a->u.ptr, BGP_AIGP_METRIC);
 +  const byte *b = bgp_aigp_get_tlv(ea->u.ptr, BGP_AIGP_METRIC);
    if (!b)
      return 0;
  
@@@ -1702,11 -1729,11 +1730,11 @@@ bgp_preexport(struct channel *c, rte *e
    }
  
    /* Handle well-known communities, RFC 1997 */
 -  struct eattr *c;
 +  struct eattr *com;
    if (p->cf->interpret_communities &&
-       (com = ea_find(e->attrs->eattrs, EA_CODE(PROTOCOL_BGP, BA_COMMUNITY))))
 -      (c = ea_find(e->attrs->eattrs, BGP_EA_ID(BA_COMMUNITY))))
++      (com = ea_find(e->attrs->eattrs, BGP_EA_ID(BA_COMMUNITY))))
    {
 -    const struct adata *d = c->u.ptr;
 +    const struct adata *d = com->u.ptr;
  
      /* Do not export anywhere */
      if (int_set_contains(d, BGP_COMM_NO_ADVERTISE))
@@@ -2278,12 -2306,12 +2306,12 @@@ bgp_rte_recalculate(rtable *table, net 
      return !old_suppressed;
  }
  
 -struct rte *
 +rte *
  bgp_rte_modify_stale(struct rte *r, struct linpool *pool)
  {
-   eattr *ea = ea_find(r->attrs->eattrs, EA_CODE(PROTOCOL_BGP, BA_COMMUNITY));
 -  eattr *a = ea_find(r->attrs->eattrs, BGP_EA_ID(BA_COMMUNITY));
 -  const struct adata *ad = a ? a->u.ptr : NULL;
 -  uint flags = a ? a->flags : BAF_PARTIAL;
++  eattr *ea = ea_find(r->attrs->eattrs, BGP_EA_ID(BA_COMMUNITY));
 +  const struct adata *ad = ea ? ea->u.ptr : NULL;
 +  uint flags = ea ? ea->flags : BAF_PARTIAL;
  
    if (ad && int_set_contains(ad, BGP_COMM_NO_LLGR))
      return NULL;
diff --cc proto/bgp/bgp.c
Simple merge
diff --cc proto/bgp/bgp.h
index cf6e2b6f287282014cb4113588278493044d2221,e04e3bd079a340d38b8be327eeba550150a82f2f..554681b4bffa1b966bcdc9a4c6c91264fd4cc38a
@@@ -571,11 -567,10 +567,10 @@@ int bgp_rte_mergable(rte *pri, rte *sec
  int bgp_rte_recalculate(rtable *table, net *net, rte *new, rte *old, rte *old_best);
  struct rte *bgp_rte_modify_stale(struct rte *r, struct linpool *pool);
  u32 bgp_rte_igp_metric(struct rte *);
 -void bgp_rt_notify(struct proto *P, struct channel *C, net *n, rte *new, rte *old);
 -int bgp_preexport(struct proto *, struct rte *);
 -void bgp_get_route_info(struct rte *, byte *buf);
 -int bgp_total_aigp_metric_(rte *e, u64 *metric, const struct adata **ad);
 +void bgp_rt_notify(struct proto *P, struct channel *C, const net_addr *n, rte *new, const rte *old);
 +int bgp_preexport(struct channel *, struct rte *);
- int bgp_get_attr(const struct eattr *e, byte *buf, int buflen);
 +void bgp_get_route_info(struct rte *, byte *);
 +int bgp_total_aigp_metric_(rta *a, u64 *metric, const struct adata **ad);
  
  #define BGP_AIGP_METRIC               1
  #define BGP_AIGP_MAX          U64(0xffffffffffffffff)
diff --cc proto/mrt/mrt.c
Simple merge
index ab77de0200c045467580bac91723f76a44b0a78d,66d0eba67612afed2587ff4f3dc1199e342217d9..e4522d41d205a55f4bc7b52f41dcf7dd547f48b5
  
  #include <stdlib.h>
  #include "ospf.h"
+ #include "lib/macro.h"
  
 -static int ospf_preexport(struct proto *P, rte *new);
 +static int ospf_preexport(struct channel *C, rte *new);
  static void ospf_reload_routes(struct channel *C);
  static int ospf_rte_better(struct rte *new, struct rte *old);
  static u32 ospf_rte_igp_metric(struct rte *rt);
diff --cc proto/ospf/rt.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc proto/rip/rip.c
Simple merge
Simple merge
Simple merge
index 7702c815563128c2839b2b1aa132cfbd09ce35b4,23d41b56c17342b54e2c628c77f68e28dd4d6777..f7c5943b9008072c8df5ce2a8c35d4a00b065227
@@@ -1577,31 -1674,23 +1673,25 @@@ nl_mergable_route(struct nl_parse_stat
  static void
  nl_announce_route(struct nl_parse_state *s)
  {
 -  rte *e = rte_get_temp(s->attrs, s->proto->p.main_source);
 -  e->net = s->net;
 +  rte e0 = {
 +    .attrs = s->attrs,
 +    .net = s->net,
 +  };
  
-   EA_LOCAL_LIST(2) ea0 = {
+   EA_LOCAL_LIST(2) ea = {
 -    .l = { .count = 2, .next = e->attrs->eattrs },
 +    .l = { .count = 2, .next = e0.attrs->eattrs },
-     .a[0] = (eattr) {
-       .id = EA_KRT_SOURCE,
-       .type = T_INT,
-       .u.data = s->krt_proto,
-     },
-     .a[1] = (eattr) {
-       .id = EA_KRT_METRIC,
-       .type = T_INT,
-       .u.data = s->krt_metric,
+     .a = {
+       EA_LITERAL_EMBEDDED(&ea_krt_source, 0, s->krt_proto),
+       EA_LITERAL_EMBEDDED(&ea_krt_metric, 0, s->krt_metric),
      },
    };
  
-   e0.attrs->eattrs = &ea0.l;
 -  e->attrs->eattrs = &ea.l;
++  e0.attrs->eattrs = &ea.l;
  
    if (s->scan)
 -    krt_got_route(s->proto, e, s->krt_src);
 +    krt_got_route(s->proto, &e0, s->krt_src);
    else
 -    krt_got_route_async(s->proto, e, s->new, s->krt_src);
 +    krt_got_route_async(s->proto, &e0, s->new, s->krt_src);
  
    s->net = NULL;
    s->attrs = NULL;
Simple merge
Simple merge