]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Removing (struct rta)->cast. Never used.
authorJan Moskyto Matejka <mq@ucw.cz>
Tue, 7 Jun 2016 09:46:07 +0000 (11:46 +0200)
committerJan Moskyto Matejka <mq@ucw.cz>
Thu, 22 Dec 2016 12:09:59 +0000 (13:09 +0100)
14 files changed:
filter/config.Y
filter/filter.c
filter/filter.h
nest/config.Y
nest/route.h
nest/rt-attr.c
nest/rt-dev.c
proto/bgp/packets.c
proto/ospf/rt.c
proto/rip/rip.c
proto/rpki/rpki.c
proto/static/static.c
sysdep/bsd/krt-sock.c
sysdep/linux/netlink.c

index 7b4178bef118475af87bc03c2a7d65e7a0b5023a..94a7e3070cd2bb5d76a3f724d01d4b51946342cc 100644 (file)
@@ -397,7 +397,7 @@ CF_KEYWORDS(FUNCTION, PRINT, PRINTN, UNSET, RETURN,
        SET, STRING, BGPMASK, BGPPATH, CLIST, ECLIST, LCLIST,
        IF, THEN, ELSE, CASE,
        TRUE, FALSE, RT, RO, UNKNOWN, GENERIC,
-       FROM, GW, NET, MASK, PROTO, SOURCE, SCOPE, CAST, DEST, IFNAME, IFINDEX,
+       FROM, GW, NET, MASK, PROTO, SOURCE, SCOPE, DEST, IFNAME, IFINDEX,
        PREFERENCE,
        ROA_CHECK, ASN,
        LEN, MAXLEN,
@@ -854,7 +854,6 @@ static_attr:
  | PROTO   { $$ = f_new_inst(); $$->aux = T_STRING;     $$->a2.i = SA_PROTO; }
  | SOURCE  { $$ = f_new_inst(); $$->aux = T_ENUM_RTS;   $$->a2.i = SA_SOURCE; }
  | SCOPE   { $$ = f_new_inst(); $$->aux = T_ENUM_SCOPE; $$->a2.i = SA_SCOPE;   $$->a1.i = 1; }
- | CAST    { $$ = f_new_inst(); $$->aux = T_ENUM_RTC;   $$->a2.i = SA_CAST; }
  | DEST    { $$ = f_new_inst(); $$->aux = T_ENUM_RTD;   $$->a2.i = SA_DEST;    $$->a1.i = 1; }
  | IFNAME  { $$ = f_new_inst(); $$->aux = T_STRING;     $$->a2.i = SA_IFNAME; }
  | IFINDEX { $$ = f_new_inst(); $$->aux = T_INT;        $$->a2.i = SA_IFINDEX; }
index 926316ac53a8451d3fa9c3dda35fdf1b9a4cac46..bc80997ffe05d9ad7ae023c5f822f3d679a4cbf1 100644 (file)
@@ -905,7 +905,6 @@ interpret(struct f_inst *what)
       case SA_PROTO:   res.val.s = rta->src->proto->name; break;
       case SA_SOURCE:  res.val.i = rta->source; break;
       case SA_SCOPE:   res.val.i = rta->scope; break;
-      case SA_CAST:    res.val.i = rta->cast; break;
       case SA_DEST:    res.val.i = rta->dest; break;
       case SA_IFNAME:  res.val.s = rta->nh.iface ? rta->nh.iface->name : ""; break;
       case SA_IFINDEX: res.val.i = rta->nh.iface ? rta->nh.iface->index : 0; break;
index a4808731e37bbdea233c408a307640b088696173..0482b83b1dd40b34761d3c31d09a67f346f7fb7f 100644 (file)
@@ -174,10 +174,9 @@ void val_format(struct f_val v, buffer *buf);
 #define SA_PROTO        4
 #define SA_SOURCE       5
 #define SA_SCOPE        6
-#define SA_CAST                 7
-#define SA_DEST                 8
-#define SA_IFNAME       9
-#define SA_IFINDEX     10
+#define SA_DEST         8
+#define SA_IFNAME       9
+#define SA_IFINDEX     10
 
 
 struct f_tree {
index 95ce59cd5e079316df549f8f8e3e95c2b437dd63..511936ef972f1d568282a7e90695157d9d7c9936 100644 (file)
@@ -78,7 +78,6 @@ CF_KEYWORDS(GRACEFUL, RESTART, WAIT, MAX, FLUSH, AS)
 CF_ENUM(T_ENUM_RTS, RTS_, DUMMY, STATIC, INHERIT, DEVICE, STATIC_DEVICE, REDIRECT,
        RIP, OSPF, OSPF_IA, OSPF_EXT1, OSPF_EXT2, BGP, PIPE, BABEL)
 CF_ENUM(T_ENUM_SCOPE, SCOPE_, HOST, LINK, SITE, ORGANIZATION, UNIVERSE, UNDEFINED)
-CF_ENUM(T_ENUM_RTC, RTC_, UNICAST, BROADCAST, MULTICAST, ANYCAST)
 CF_ENUM(T_ENUM_RTD, RTD_, UNICAST, BLACKHOLE, UNREACHABLE, PROHIBIT)
 CF_ENUM(T_ENUM_ROA, ROA_, UNKNOWN, VALID, INVALID)
 
index 37c9abfbcf3f4c8a4619f46302232cc182705398..154e027ec8e02e14fe65cf2b7363c6918477c8c0 100644 (file)
@@ -358,13 +358,10 @@ typedef struct rta {
   struct hostentry *hostentry;         /* Hostentry for recursive next-hops */
   ip_addr from;                                /* Advertising router */
   u32 igp_metric;                      /* IGP metric to next hop (for iBGP routes) */
-  u32 bf[0];
-  u32 source:6;                                /* Route source (RTS_...) */
-  u32 scope:6;                         /* Route scope (SCOPE_... -- see ip.h) */
-  u32 cast:6;                          /* Casting type (RTC_...) */
-  u32 dest:6;                          /* Route destination type (RTD_...) */
-//  u32 eflags:8;                              /* Flags (RTAF_...) */
-  u32 aflags:8;
+  u8 source;                           /* Route source (RTS_...) */
+  u8 scope;                            /* Route scope (SCOPE_... -- see ip.h) */
+  u8 dest;                             /* Route destination type (RTD_...) */
+  u8 aflags;
   struct nexthop nh;                   /* Next hop */
 } rta;
 
index 0eacfe3f70d97c61ca99069654df19a13480bffa..e575ba4a61f3c26f5178257751dec17f71e4138b 100644 (file)
@@ -1008,7 +1008,9 @@ rta_hash(rta *a)
   MIX(hostentry);
   MIX(from);
   MIX(igp_metric);
-  mem_hash_mix(&h, a->bf, sizeof(u32));
+  MIX(source);
+  MIX(scope);
+  MIX(dest);
 #undef MIX
 
   return mem_hash_value(&h) ^ nexthop_hash(&(a->nh)) ^ ea_hash(a->eattrs);
@@ -1020,7 +1022,6 @@ rta_same(rta *x, rta *y)
   return (x->src == y->src &&
          x->source == y->source &&
          x->scope == y->scope &&
-         x->cast == y->cast &&
          x->dest == y->dest &&
          x->igp_metric == y->igp_metric &&
          ipa_equal(x->nh.gw, y->nh.gw) &&
@@ -1163,11 +1164,10 @@ rta_dump(rta *a)
                         "RTS_STAT_DEV", "RTS_REDIR", "RTS_RIP",
                         "RTS_OSPF", "RTS_OSPF_IA", "RTS_OSPF_EXT1",
                          "RTS_OSPF_EXT2", "RTS_BGP", "RTS_PIPE", "RTS_BABEL" };
-  static char *rtc[] = { "", " BC", " MC", " AC" };
   static char *rtd[] = { "", " DEV", " HOLE", " UNREACH", " PROHIBIT" };
 
-  debug("p=%s uc=%d %s %s%s%s h=%04x",
-       a->src->proto->name, a->uc, rts[a->source], ip_scope_text(a->scope), rtc[a->cast],
+  debug("p=%s uc=%d %s %s%s h=%04x",
+       a->src->proto->name, a->uc, rts[a->source], ip_scope_text(a->scope),
        rtd[a->dest], a->hash_key);
   if (!(a->aflags & RTAF_CACHED))
     debug(" !CACHED");
@@ -1213,10 +1213,9 @@ rta_show(struct cli *c, rta *a, ea_list *eal)
 {
   static char *src_names[] = { "dummy", "static", "inherit", "device", "static-device", "redirect",
                               "RIP", "OSPF", "OSPF-IA", "OSPF-E1", "OSPF-E2", "BGP", "pipe" };
-  static char *cast_names[] = { "unicast", "broadcast", "multicast", "anycast" };
   int i;
 
-  cli_printf(c, -1008, "\tType: %s %s %s", src_names[a->source], cast_names[a->cast], ip_scope_text(a->scope));
+  cli_printf(c, -1008, "\tType: %s %s", src_names[a->source], ip_scope_text(a->scope));
   if (!eal)
     eal = a->eattrs;
   for(; eal; eal=eal->next)
index 43628af82165c31ca4e479cf1ff0efaa135831bc..5edd1c5d8c5f3dbe25dddee72112efe3ec88ecb7 100644 (file)
@@ -78,7 +78,6 @@ dev_ifa_notify(struct proto *P, uint flags, struct ifa *ad)
        .src = src,
        .source = RTS_DEVICE,
        .scope = SCOPE_UNIVERSE,
-       .cast = RTC_UNICAST,
        .dest = RTD_UNICAST,
        .nh = {
          .iface = ad->iface
index 0baa84c999950d330c3e2050cb2fd7b0c7be85bc..9c59e6d87cd9c0a2abe84bc70395dd1583ea627a 100644 (file)
@@ -1439,7 +1439,6 @@ bgp_decode_nlri(struct bgp_parse_state *s, u32 afi, byte *nlri, uint len, ea_lis
 
     a->source = RTS_BGP;
     a->scope = SCOPE_UNIVERSE;
-    a->cast = RTC_UNICAST;
     a->dest = RTD_UNREACHABLE;
     a->from = s->proto->cf->remote_ip;
     a->eattrs = ea;
index 09cc57761b4f26f17aeaf808393a65739f5fdab9..d28d463bef14abbe07af01a401d170cf9d2f0687 100644 (file)
@@ -1951,7 +1951,6 @@ again1:
        .src = p->p.main_source,
        .source = nf->n.type,
        .scope = SCOPE_UNIVERSE,
-       .cast = RTC_UNICAST
       };
 
       nexthop_link(&a0, nf->n.nhs);
index 8b09330cb1ee968d3562704b232e4ad8af25d244..9bed9249f3dabd77571c2c282ad53bccd52d7831 100644 (file)
@@ -147,7 +147,6 @@ rip_announce_rte(struct rip_proto *p, struct rip_entry *en)
       .src = p->p.main_source,
       .source = RTS_RIP,
       .scope = SCOPE_UNIVERSE,
-      .cast = RTC_UNICAST
     };
 
     u8 rt_metric = rt->metric;
index 6360dbaff133b12f308cce59282171a8419ea1eb..81268e83e41753df097a8851e773585a8bcdc574 100644 (file)
@@ -124,7 +124,6 @@ rpki_table_add_roa(struct rpki_cache *cache, struct channel *channel, const net_
     .src = p->p.main_source,
     .source = RTS_RPKI,
     .scope = SCOPE_UNIVERSE,
-    .cast = RTC_UNICAST,
     .dest = RTD_BLACKHOLE,
   };
 
index f3cfec010ee3aabe7473863079d31da6b2ae2271..a63d4d29088f8698c74e713bf36004f76abe8059 100644 (file)
@@ -71,7 +71,6 @@ static_install(struct proto *p, struct static_route *r)
   a.src = p->main_source;
   a.source = ((r->dest == RTD_UNICAST) && ipa_zero(r->via)) ? RTS_STATIC_DEVICE : RTS_STATIC;
   a.scope = SCOPE_UNIVERSE;
-  a.cast = RTC_UNICAST;
   a.dest = r->dest;
   if (r->dest == RTD_UNICAST)
     {
@@ -210,13 +209,13 @@ static_add(struct proto *p, struct static_config *cf, struct static_route *r)
          }
 
        if (count)
-         static_install(p, r, NULL);
+         static_install(p, r);
 
        break;
       }
 
     default:
-      static_install(p, r, NULL);
+      static_install(p, r);
     }
 }
 
@@ -300,7 +299,7 @@ static_update_rte(struct proto *p, struct static_route *r)
     return;
 
   if (static_decide((struct static_config *) p->cf, r))
-    static_install(p, r, r->neigh->iface);
+    static_install(p, r);
   else
     static_remove(p, r);
 }
@@ -367,7 +366,7 @@ static_if_notify(struct proto *p, unsigned flags, struct iface *i)
     {
       WALK_LIST(r, c->iface_routes)
        if (!strcmp(r->if_name, i->name))
-         static_install(p, r, i);
+         static_install(p, r);
     }
   else if (flags & IF_CHANGE_DOWN)
     {
@@ -535,7 +534,7 @@ static_reconfigure(struct proto *p, struct proto_config *CF)
     {
       struct iface *ifa;
       if ((ifa = if_find_by_name(r->if_name)) && (ifa->flags & IF_UP))
-       static_install(p, r, ifa);
+       static_install(p, r);
     }
   WALK_LIST(r, n->other_routes)
     static_add(p, n, r);
index fbaa8e3214cf84266c959b77e5dee6906e2b66e0..2e0f194b5ab5b6d92c20197f7da60225cba5f795 100644 (file)
@@ -147,7 +147,6 @@ krt_capable(rte *e)
   rta *a = e->attrs;
 
   return
-    a->cast == RTC_UNICAST &&
     ((a->dest == RTD_UNICAST && !a->nh.next) /* No multipath support */
 #ifdef RTF_REJECT
      || a->dest == RTD_UNREACHABLE
@@ -470,7 +469,6 @@ krt_read_route(struct ks_msg *msg, struct krt_proto *p, int scan)
     .src = p->p.main_source,
     .source = RTS_INHERIT,
     .scope = SCOPE_UNIVERSE,
-    .cast = RTC_UNICAST
   };
 
   /* reject/blackhole routes have also set RTF_GATEWAY,
index 6e75ee53c4344b6c0c4267ed7701fb00640a9a16..c9a30719267d7c49b79b54c46f752f229054e65c 100644 (file)
@@ -952,9 +952,6 @@ krt_capable(rte *e)
 {
   rta *a = e->attrs;
 
-  if (a->cast != RTC_UNICAST)
-    return 0;
-
   switch (a->dest)
     {
     case RTD_UNICAST:
@@ -1345,7 +1342,6 @@ nl_parse_route(struct nl_parse_state *s, struct nlmsghdr *h)
   ra->src = p->p.main_source;
   ra->source = RTS_INHERIT;
   ra->scope = SCOPE_UNIVERSE;
-  ra->cast = RTC_UNICAST;
 
   switch (i->rtm_type)
     {